Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/05/22 in all areas

  1. Fr0sT.Brutal

    Find, Replace and Save

    @programmerdelphi2k I believe that you have 2 problems now: 1) Too MUCH EXCLAMATIONS!!!! 2) Too much RED color Could you calm down plz.
  2. You should start from scratch. Trust me, frequently when doing so, people find themself the error they made or can't reproduce their own issue. Then then fix themself their code in their larger application based on the small example.
  3. No. First, not even considering threads yet, TApplication is simply not designed to run multiple instances at a time. There are globals that it uses internally which it assumes it has exclusive access to, and will not share well with other instances. Also, there is plenty of code inside of the VCL that assumes there is only 1 global TApplication object, and won't even consider the existence of other instances. Second, considering threads, the VCL is simply not thread-safe to begin with. It is not designed to be used in multiple threads at a time. VCL controls are expected to be used only in the main UI thread which runs the single global TApplication object. Also, the VCL runs on top of the Win32 API, and API window handles have an affinity to the thread that creates them, which restricts which threads are allowed to access them. And VCL controls simply don't react well when those window handles get messed up when accessed across thread boundaries. Don't do it. That is a very bad design choice. Handle all of your UI needs in the default main UI thread only. You can use multiple worker threads to handle your business logic however you want, and you can create a separate TForm to associate with each worker thread if that is what you need. Just make sure that any data you share across threads is adequately protected from concurrent access, and that you have worker threads synchronize with the main UI thread whenever they need to access the UI.
  4. David Heffernan

    How to open a file in the already running IDE?

    I'm very sorry!! I got carried away. Is it possible that DDE is being used? That was how this would have been done in the old days.
  5. programmerdelphi2k

    How to handle/close FreeReport's Preview? (D7)

    to access fields/property protected you can try: type TMyHack = class( TClass_to_Hack ) ;;// ex.: TfrxPreview ... to usage TMyHack( instance of object ).xxxxProperty/Field Ex.: TMyHack( MyPreview )
  6. programmerdelphi2k

    How to open a file in the already running IDE?

    nop! LOperation := PWideChar('open'); LExec := PWideChar('C:\RADStudio\RX112\bin\BDSLauncher.exe C:\RADStudio\RX112\bin\BDS.EXE /np D:\myfile.pas '); // DOESNT WORKS TOO! at least here! LParams := ''; // PWideChar('d:\myfile.pas'); LDirWork := ''; // PWideChar('d:\'); // ShellExecute(Handle, LOperation, LExec, LParams, LDirWork, SW_SHOWNORMAL)
  7. programmerdelphi2k

    Keep getting Expected and identifier but received VAR same for IN and Contains

    my fault: change " for var in AFilenames do" by "for var F in AFilenames do" xxx.AddFilenames( [ 'name1', 'name2', etc... ] );
  8. Lars Fosdal

    How do I delete a row in a database with FireDAC?

    The point of identity fields is to be able to do table joins without relying on unique keys in your data. You can still have other unique keys - f.x. for books, it could be the ISBN, for warehouse articles it could be the EAN code, for shipping containers it could be SSCC. All of these are supposed to be unique - but they are strings, and hence far more expensive with regards to space and computation. And - at times, those unique IDs might not be available at the time of insertion (example of unique field that allows for multiple rows with field = null). As I mentioned - the point of the identity field is to be able to create relations without involving the actual data. The value will not change for the lifetime of the row(s), even if you later change all the actual data for that record - including other columns that must be unique.
  9. Fr0sT.Brutal

    form data store component ?

    While you've found what you were looking for, I suspect you misunderstood "resource" approach. It's not about resourcestrings. It's just one .RC file with single line "StrRes RCData "StrRes.txt"" and one call to TResourceStream at runtime. Elementary but it has advantage of separating form definition from text data which is more convenient for version control
  10. programmerdelphi2k

    How to handle/close FreeReport's Preview? (D7)

    It would be some like this: {$R *.dfm} uses frxClass, frxPreview; var MyFastReport : TfrxReport; MyFastPreview: TfrxPreview; procedure TForm1.FormCreate(Sender: TObject); begin MyFastReport := TfrxReport.Create(nil); // creating on create-form for quick access... MyFastPreview := TfrxPreview.Create(nil); end; procedure TForm1.FormDestroy(Sender: TObject); begin MyFastPreview.Free; // destroying on form-destroy! MyFastReport.Free; end; procedure TForm1.BtnPreparePreviewClick(Sender: TObject); begin if (MyFastReport <> nil) and (MyFastPreview <> nil) then begin MyFastPreview.Parent := Panel1; // show the "Preview" into "Panel1" MyFastPreview.Align := TAlign.alClient; // // loading a saved FR file... for quick tests! MyFastReport.LoadFromFile('D:\RADRX112Tests\__TEMP\Untitled.fr3'); // // assigning and preparing to show report on Preview... MyFastReport.Preview := MyFastPreview; // MyFastReport.PrepareReport(true); end; end; procedure TForm1.BtnClosePreviewClick(Sender: TObject); begin MyFastReport.Preview := nil; // unAssigning Preview MyFastPreview.Parent := nil; end; end.
  11. programmerdelphi2k

    problem on update sdk ndk in delphi 11

    in fact, the Android SDK/NDK is not installed, on exact word sense! it is just "copyed" to your disk! this said, you can copy from any other pc!!! now, you can update it usando command line: skdmanager.bat is in "<<sdk root>>"\command-line\bin" skdmanager.bat --sdk_root=<<Path root of your Android SDK>> "<< pacakge names to update or install" --list <--- for all packages avaliable on Google) --list_installed <--- for all packages installed in your computer sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --list for example: install/update/uninstall 2 packages named: "build-tools;31.0.0" and "cmdline-tools;v5" sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> "build-tools;31.0.0" "cmdline-tools;v5" sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --update "build-tools;31.0.0" "cmdline-tools;v5" sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --uninstall "build-tools;31.0.0" "cmdline-tools;v5" you can download Android Studio if you dont have your NDK!!! later, just copy NDK folder for you disk (in any folder than desire) if you want uninstall Android Studio!!! because it's not necessary have it installed! after this, just config your RAD IDE!!! to updates your SDK/NDK just use the command-line above!
  12. programmerdelphi2k

    How do I delete a row in a database with FireDAC?

    if can use "int64"... starting in min-Int64 to max-Int64! -9.223.372.036.854.775.808 +1, +1, +1... to +9.223.372.036.854.775.807 = 18.... at least, your brain can rest a little longer! ( I think ... but if you're ZKeeZOfranic.. .
  13. Remy Lebeau

    DL a file from the web

    It raises an exception on error. However, internally it uses Windows' Urlmon.URLDownloadToFile() function, which is notoriously buggy, and crappy at reporting errors.
  14. David Heffernan

    Create multiple instances of tApplication with multiple MainThreads?

    This isn't really true. You can have multiple threads that serve multiple windows with different message loops. Windows supports that. What you can't do is do that in vcl.
  15. Dalija Prasnikar

    Create multiple instances of tApplication with multiple MainThreads?

    It is complicated... In theory you can have Windows application that has multiple GUI threads with each one holding own windows message loop. The answer is no, because VCL is build on the premise of single main (GUI) thread (like many other frameworks as there is really no advantage of having such multithreaded GUI) and you would have to write your own framework to achieve such application and probably would have to rewrite significant parts of the RTL.
×