Jump to content

programmerdelphi2k

Members
  • Content Count

    1406
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by programmerdelphi2k

  1. programmerdelphi2k

    VCL or FMX: My sample using Thread running in another forms for some tasks...

    Ops!!!! exists a little error in my code using "global things" :)>.. LHowManyThreadRunning := Length(LArrThreads); // cause stop the other forms.... then, dont use "global vars" all time... of course, you can do at "OnTerminate()" from thread... but it's "global var" yet 😠
  2. programmerdelphi2k

    How to set FMX TWebBrowser UserDataFolder?

    SHDocVw.TWebBrowser.EdgeUserDataFolder on Help: If SelectedEngine is EdgeOnly, or is EdgeIfAvailable and Edge is available, then the EdgeUserDataFolder property tells Edge (or, more accurately, the WebView2 runtime) in which folder to store user data (e.g. cookies, permissions and cached resources). This property defaults to a local app data folder (i.e. the folder in which the path is stored in the LOCALAPPDATA environment variable) called <executable_file_name>.WebView2. The property value can include embedded environment variables if needed (e.g. %LOCALAPPDATA%\MyEdgeCacheFolder). Note: Microsoft states "The app is responsible to clean up the associated user data folder when it is done." uses SHDocVw; // <--- procedure TForm1.Button1Click(Sender: TObject); var MyWebBrowser: TWebBrowser; begin ... MyWebBrowser.EdgeUserDataFolder := '.....'; end;
  3. programmerdelphi2k

    How to set FMX TWebBrowser UserDataFolder?

    see this Gibhub project https://stackoverflow.com/questions/64433920/avoid-userdatafolder-for-ms-edge-webview2
  4. programmerdelphi2k

    How to set FMX TWebBrowser UserDataFolder?

    I think that not because all setup was already defined on WebView2, for that you'll need re-CALL it as above...
  5. programmerdelphi2k

    Not Threadsafe??

    you're right! 👍
  6. programmerdelphi2k

    ADO CONNECTION

    I think that you needs just add the "ODBC driver" for MSAccess +2007... or, install MSOffice, LibreOffice or OpenOffice suites Microsoft Access Database Engine 2010 Redistributable https://www.microsoft.com/en-us/download/details.aspx?id=13255 This download will install a set of components that facilitate the transfer of data between existing Microsoft Office files such as Microsoft Office Access 2010 (*.mdb and *.accdb) files and Microsoft Office Excel 2010 (*.xls, *.xlsx, and *.xlsb) files to other data sources such as Microsoft SQL Server. Connectivity to existing text files is also supported. ODBC and OLEDB drivers are installed for application developers to use in developing their applications with connectivity to Office file formats. create a DSN file and use it on FDConnection (.. ODBCAdvanced params...)
  7. programmerdelphi2k

    Copy bitmap from one app to another app bitmap

    since you can't use the disk for security reasons, you could create a type (defined by the programmer) and store it in the memory (on the clipboard as MS Windows does) that stores the bitmap data (cloaked or not, compressed or no, etc) then that the other application could query and review for its use? ... a kind of new type of data registered in the system for specific use in your application, got it?
  8. programmerdelphi2k

    Not Threadsafe??

    ... if only one, then main-thread it's enough.
  9. programmerdelphi2k

    Not Threadsafe??

    the use of variables to determine flow control, as used above, can lead to the false security of creating new threads/execution in the same unit, since any other "thread in the same unit" could change the value of these variables, allowing chaos is installed.
  10. programmerdelphi2k

    How to set FMX TWebBrowser UserDataFolder?

    did you see in "Winapi.EdgeUtils.pas"? you have "CreateCoreWebView2EnvironmentWithOptions" NOTE: after changing the UserDataFolder or BrowserExecutableFolder property, you must reinitialize the WebView2 by calling the ReinitializeWebView or ReinitializeWebViewWithNewBrowser method.
  11. programmerdelphi2k

    Suddenly can't resize forms in IDE??

    not for that!
  12. programmerdelphi2k

    Suddenly can't resize forms in IDE??

    do the test: open an old project, and ADD a new form (not inheriting)... works?
  13. programmerdelphi2k

    Suddenly can't resize forms in IDE??

    have you try create a "NEW" app and resize the "form"? (not your old projects)
  14. programmerdelphi2k

    Not Threadsafe??

    here an Elevante article about MultiThreading and DB sessions... https://www.elevatesoft.com/manual?action=viewtopic&amp;id=dbisam4&amp;product=delphi&amp;version=5&amp;topic=multi_threaded_applications
  15. programmerdelphi2k

    Not Threadsafe??

    you must understand that a "Thread" is like "another software within your software" (an Aliens) 🙂, that is, you need to deal with it as if you were always checking what the "other software is doing at this moment within the your software". Therefore, it is always necessary not to mix background tasks (the thread) with foreground tasks (your app). Therefore, when it is necessary to update the interface, you are obliged to ask for some "synchronization with the main thread". It's like an arm wrestling match... and we hope we always win, otherwise chaos will ensue... When you use "Application.ProcessMessages", you are forcing the application to always pay special attention to its task, regardless of what it is doing at the moment. And, in the case of using the database, we must take into account that, after you send a command to the database, you are delegating a task to it, and therefore, you must hope that everything goes well there, otherwise , you will get an exception that will propagate through your background thread, which will affect the functioning of your main thread (your app). So, while nothing really serious happens, it doesn't mean your code is 100%. But, simply, that he still hasn't found something so serious that it could stop everything! Creating an anonymous thread is not necessarily creating a multi-parallel task! A background thread is just a background thread! Multi-parallelism is when many threads work in a way that, in human perception, and, moreover, use multiple CPUs simultaneously. maybe help you if reading the FireDAC way in https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Multithreading_(FireDAC) basically, the "magic" happens on TFDManager (all FDConnection have it, same that you dont create it) it do the "pooling service control", a semaphore to the connections... the hierachy in FireDAC is: TFDManager -> TFDConnection -> TFD_datasets_objects, then, always exists 1 FDManager! It is the FDManager who is responsible for sharing the connections with the database, in order to avoid the bottlenecks of initializing the connection itself. Realize that each thread must create its own database access objects, however, it is the FDManager who determines which connections will be used, and by who is registered in it. There will be only one FDManager, which shares its information with every FDConnection you create. However, only in connections of the type "Private ( FDConnection created in each thread)" or "Persistent (defined in the FireDAC FDConnectionDefs.ini file) " Now, try to see the differences between your code and the one used in FireDAC...
  16. programmerdelphi2k

    File icons disappeared

    try re-assing all files to RAD in "Tool" menus "File Associations" --> uncheck, re-check (if necessary as ADMIN) note: maybe your "versioning tools" hijacked it!
  17. programmerdelphi2k

    String literals more then 255 chars

    See how the human is something very peculiar: When we only had 80 lines on the screen (D.O.S. era), we complained about that (because we would like to be able to visualize more "things" on the same line)... Now, the lucky ones, can have 8K screens (we can display thousands of "things" per line), and still complain, because "it hurts my eyes to have to turn my head to be able to see the whole line) So I ask: Is the "human" still the same as before, or has he evolved?
  18. programmerdelphi2k

    Edits not saved??

    many IDE open, you can have many files (copy) opened! Code Editor allow +1 window of same unit file opened share file can cause confusion of course! the human-memory can fail :)))
  19. programmerdelphi2k

    Using Bass.dll and add-ons in a Delphi project

    look, using the link above (from site) you can this: the "BASS.PAS" is in "..\bas24\Delphi folder", then, if your project dont have, just add it!!! the "BASS.DLL" is in "..\base24" (32bits) and "..\base24\x64" (64bits) , then, you dont need copy from another place!!! the "DLL" should be where your EXEcutable is it!!! for example, if your EXE is in "c:\myBASSDemo", then, it's here where it should be!!! this files is found https://www.un4seen.com/download.php?bass24 zip downloaded!!!
  20. programmerdelphi2k

    Component caption does not appear in sample application

    ok, but this is the direction!!!
  21. programmerdelphi2k

    Component caption does not appear in sample application

    look in TOOL, User Interface, Form Designer --> check Show Component Caption
  22. programmerdelphi2k

    Edits not saved??

    ok! I never use this!!! = uncheck always! 🙂
  23. programmerdelphi2k

    Edits not saved??

    hi @Ian Branch look at "Tools > Options > Environment Options >"
  24. programmerdelphi2k

    bitmap is not displayed

    not only in VCL, but in any other environment... unfortunatelly I lost the beggin in programming ... I would like have learned more about the "root" I would like to be a "cave-man" too! 😪
×