-
Content Count
1406 -
Joined
-
Last visited
-
Days Won
22
Everything posted by programmerdelphi2k
-
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
cest la vie, mon cherry! -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
sorry, on copy I did wrong ... but the result is the same = WORKS! LWinReg := TRegistry.Create; try LWinReg.RootKey := HKEY_CURRENT_USER; if LWinReg.KeyExists('SOFTWARE\Embarcadero\BDS\22.0') then begin if LWinReg.OpenKeyReadOnly('SOFTWARE\Embarcadero\BDS\22.0') then -
it would be because "Ctrl+F" is a "Search on Editor-code"?
-
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
according with "Raymond Chen" MVP MS, it's ShellExecute is a "little box" very complicate to understand an easy to use! -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
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) -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
nop! procedure TForm1.Button2Click(Sender: TObject); var LOperation: PWideChar; LExec : PWideChar; LParams : PWideChar; LDirWork : PWideChar; begin LOperation := PWideChar('open'); LExec := PWideChar('C:\RADStudio\RX112\bin\bdslauncher.exe BDS.EXE /np d:\myfile.pas'); LParams := ''; // PWideChar('d:\myfile.pas'); LDirWork := ''; // PWideChar('d:\'); // ShellExecute(Handle, LOperation, LExec, LParams, LDirWork, SW_SHOWNORMAL) end; but this works with IDE on memory or not! procedure TForm1.Button1Click(Sender: TObject); var LShExecInfo : TShellExecuteInfo; LShExecInfoSize: NativeUInt; LWinReg : TRegistry; LHKEY : HKEY; // LKeyString : string; begin // "App"="c:\\radstudio\\rx112\\bin\\bds.exe" // C:\RADStudio\RX112\bin\bds.exe "-pDelphi" -np LHKEY := 0; LWinReg := TRegistry.Create; try if LWinReg.KeyExists('HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0') then begin LWinReg.OpenKeyReadOnly('HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0'); LHKEY := LWinReg.CurrentKey; // LKeyString := LWinReg.ReadString('App'); end; // LShExecInfoSize := SizeOf(LShExecInfo); // 60... // ZeroMemory(@LShExecInfo, LShExecInfoSize); // LShExecInfo.cbSize := SizeOf(LShExecInfo); LShExecInfo.fMask := SEE_MASK_CLASSNAME; // or SEE_MASK_CLASSKEY; LShExecInfo.lpFile := PChar('d:\myfile.pas'); LShExecInfo.lpClass := '.pas'; LShExecInfo.hkeyClass := LHKEY; LShExecInfo.nShow := SW_SHOWNORMAL; // ShellExecuteEx(@LShExecInfo); finally LWinReg.Free; end; end; -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
in my test, would be necessary "Create a process" or verify if the "Process X" in opened on memory"... then, use this ID to open your file! -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
LOperation := PWideChar('open'); LExec := PWideChar('C:\RADStudio\RX112\bin\bdslauncher.exe'); // dont works for here, nothing is opened!!! no error at all! LParams := PWideChar('d:\myfile.pas'); LDirWork := ''; // PWideChar('d:\'); // ShellExecute(Handle, LOperation, LExec, LParams, LDirWork, SW_SHOWNORMAL) -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
LShExecInfo.hkeyClass == use Registry definition... maybe you can use the key where is definide the "exe from RAD" desired!!! --> try some like this! -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
use "o BDS path\exe" as your first param, and the file name .pas as second! then, you "force" use only "bdsXXX" to open file.pas! dont forget: qualify the paths! -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
here, a code from @David Heffernan on StackOverFlow that works like a charm https://stackoverflow.com/questions/16941455/how-do-i-open-a-file-with-the-default-text-editor procedure TForm1.Button1Click(Sender: TObject); var sei: TShellExecuteInfo; begin ZeroMemory(@sei, SizeOf(sei)); sei.cbSize := SizeOf(sei); sei.fMask := SEE_MASK_CLASSNAME; sei.lpFile := PChar('d:\myfile.pas'); sei.lpClass := '.pas'; sei.nShow := SW_SHOWNORMAL; ShellExecuteEx(@sei); end; or just: PChar or PWideChar ? procedure TForm1.Button2Click(Sender: TObject); var LOperation: PWideChar; LExec : PWideChar; LParams : PWideChar; LDirWork : PWideChar; begin LOperation := PWideChar('open'); LExec := PWideChar('d:\myfile.pas'); LParams := PWideChar(''); LDirWork := PWideChar('d:\'); // ShellExecute(Handle, LOperation, LExec, LParams, LDirWork, SW_SHOWNORMAL) end; -
How to open a file in the already running IDE?
programmerdelphi2k replied to aehimself's topic in Delphi IDE and APIs
I think that it's not problem with your code, but with REGISTRY definitions to RAD Studio! I think that you needs pay attention if your "IDE" is registering "* files using by RAD" in Tools->IDE->File Associaton = * I once had a problem that when I clicked on a ".pas" file (for example), the O.S. insisted on opening a new session for a new "IDE RAD Studio", even with the option above set to "all files associated with RAD Studio"... In short, I had to "deselect" and "select" the above option again, in order for the REGISTRY to be updated! From there, everything went back to working as expected! So maybe this can help you with this task! UnSelect and Re-Select again the option and try your tool! -
it would be this: RAD 11.2 Alexandria! if not, try this: on RAD 10.4 save your profile (whole) ... using "migrationtool.exe" on RAD 11 do the same, and compare the values using "Beyond Compare" -- Edit->Compare->Beyond Compare
-
Create multiple instances of tApplication with multiple MainThreads?
programmerdelphi2k replied to microtronx's topic in VCL
maybe yes, maybe no! you can use a specifc "query" to filter your data before bind it to cxGrid! the query-return will so quick than your system! you can works in "offline" mode (cache) but I think that your better choice would be contact DevExpress for more details! -
Keep getting Expected and identifier but received VAR same for IN and Contains
programmerdelphi2k replied to Linuxuser1234's topic in FMX
my fault: change " for var in AFilenames do" by "for var F in AFilenames do" xxx.AddFilenames( [ 'name1', 'name2', etc... ] ); -
Create multiple instances of tApplication with multiple MainThreads?
programmerdelphi2k replied to microtronx's topic in VCL
maybe be better review your "query" parameters to avoid excessive records on cxGrid, or send it in "batch" to screen! cxGrid can define how much records can be loaded by time! -
problem on update sdk ndk in delphi 11
programmerdelphi2k replied to saeedbay's topic in Cross-platform
I prefere manual update, and works! -
How to handle/close FreeReport's Preview? (D7)
programmerdelphi2k replied to PizzaProgram's topic in VCL
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. -
problem on update sdk ndk in delphi 11
programmerdelphi2k replied to saeedbay's topic in Cross-platform
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! -
How do I delete a row in a database with FireDAC?
programmerdelphi2k replied to JohnLM's topic in Databases
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.. . -
How to handle/close FreeReport's Preview? (D7)
programmerdelphi2k replied to PizzaProgram's topic in VCL
please show your code to create it and say: How would you like to procede? -
again! I can say to you this: my code find "ANY NUMBER OF OCCORRENCES" (expressed in BYTES), and I can do the CHANGES for ANY PATTERN (in BYTES), since that: BYTES FOUND IS SAME SIZE THE PATTERN SIZE PATTERN SIZE MINOR THAN FILE SIZE! DOES NOT MATTER THE FILE SIZE! JUST 1 PASS!!! I dont load it on memory!!! just the bytes (buffer) necessary to read it! this buffer can have any size! my "changes" is done in the SAME FILE!!! -- of course, for avoid any "problems", do the backup before! why I dont do it: because the file can have 1Byte or 1TERABytes... then, because that I dont do backup on code! but you CAN DO IT!
-
How to handle/close FreeReport's Preview? (D7)
programmerdelphi2k replied to PizzaProgram's topic in VCL
maybe help you: https://www.fast-report.com/public_download/docs/FRVCL/online/en/ProgrammerManual/en-US/Working_with_TfrxReport_component/Creating_a_custom_preview_window.html https://www.fast-report.com/public_download/docs/FRVCL/online/en/ProgrammerManual/en-US/Working_with_TfrxReport_component/Creating_a_report_form_from_code.html -
no, no, no! I can do any number of searches, no matter what size pattern is used! If there are 1000 occurrences within the file, I can find them all and replace them! It doesn't matter the size of the "pattern" I'm looking for! The only restriction is: the pattern size must be smaller than the file size!