Jump to content

dmitrybv

Members
  • Content Count

    86
  • Joined

  • Last visited

Community Reputation

5 Neutral

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I tested RAD Studio 12.1 Community Edition. For this edition, the "Detail" properties of the bds.exe contain the value “Personal”. I don’t know what the value Personal means and whether it is related to the concept of Edition at all.
  2. Yes, in a real application I use the registry branch Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\23.0 to get the value for the App parameter that stores the path to bds.exe I try to keep the demo code to a minimum so that it is clear what problem I am discussing here.
  3. It seems that the solution with "bds.exe /ProductInfo:SKU" is suitable, but it does not work in the classic function of outputting the results of the StdOutput work via CreatePipe. Can you tell me how to correctly redirect the results passed to StdOutput to TMemo? I am trying to use the following code, but TMemo remains empty. At the same time, if you create a BdsGetSKU.Cmd file with the text C:\RADStudio\23.0\bin\bds.exe /ProductInfo:SKU and run it in cmd, the text "Enterprise" is output in cmd. procedure RunConsoleAppAndCaptureOutput(const ACommandLine, AWorkingDir: string; AMemo: TMemo); var SecurityAttr: TSecurityAttributes; ReadPipe, WritePipe: THandle; StartupInfo: TStartupInfo; ProcessInfo: TProcessInformation; Buffer: array[0..255] of AnsiChar; BytesRead: DWORD; AppRunning: DWORD; Output: TStringStream; CommandLineMutable: array[0..1023] of Char; begin AMemo.Clear; SecurityAttr.nLength := SizeOf(TSecurityAttributes); SecurityAttr.bInheritHandle := True; SecurityAttr.lpSecurityDescriptor := nil; if not CreatePipe(ReadPipe, WritePipe, @SecurityAttr, 0) then begin AMemo.Lines.Add('Failed to create channel.'); Exit; end; FillChar(StartupInfo, SizeOf(StartupInfo), 0); StartupInfo.cb := SizeOf(StartupInfo); StartupInfo.hStdOutput := WritePipe; StartupInfo.hStdError := WritePipe; StartupInfo.dwFlags := STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW; StartupInfo.wShowWindow := SW_HIDE; StrPLCopy(CommandLineMutable, ACommandLine, Length(ACommandLine) + 1); if not CreateProcess( nil, CommandLineMutable, nil, nil, True, 0, nil, PChar(AWorkingDir), // <- working directory StartupInfo, ProcessInfo ) then begin AMemo.Lines.Add('Failed to start process.'); CloseHandle(ReadPipe); CloseHandle(WritePipe); Exit; end; CloseHandle(WritePipe); Output := TStringStream.Create; try repeat BytesRead := 0; if ReadFile(ReadPipe, Buffer, SizeOf(Buffer) - 1, BytesRead, nil) and (BytesRead > 0) then begin Buffer[BytesRead] := #0; Output.WriteString(String(AnsiString(Buffer))); end; GetExitCodeProcess(ProcessInfo.hProcess, AppRunning); until AppRunning <> STILL_ACTIVE; // Read the rest while ReadFile(ReadPipe, Buffer, SizeOf(Buffer) - 1, BytesRead, nil) and (BytesRead > 0) do begin Buffer[BytesRead] := #0; Output.WriteString(String(AnsiString(Buffer))); end; AMemo.Lines.Text := Output.DataString; finally Output.Free; CloseHandle(ReadPipe); CloseHandle(ProcessInfo.hProcess); CloseHandle(ProcessInfo.hThread); end; end; procedure TForm1.Button1Click(Sender: TObject); begin // RunConsoleAppAndCaptureOutput(Edit1.Text, 'C:\RADStudio\23.0\bin', Memo1); // RunConsoleAppAndCaptureOutput('cmd /c dir', 'C:\Windows', Memo1); RunConsoleAppAndCaptureOutput('C:\RADStudio\23.0\bin\bds.exe /ProductInfo:SKU', 'C:\RADStudio\23.0\bin', Memo1); // RunConsoleAppAndCaptureOutput('C:\RADStudio\23.0\Projects\CommandLineInterpreter\BdsGetSKU.Cmd /ProductInfo:SKU', 'C:\RADStudio\23.0\bin', Memo1); end;
  4. dcc32.exe does not generate any error. You can understand that something went wrong only at the end of the installation, when bpl packages are registered in the registry for IDE. dcc32.exe does not create bpl packages and then it is already clear. But I want to give the user information about the impossibility of installation before the installation process begins.
  5. dcc32.exe is present in RAD Studio 12.3 Community Edition. It runs without errors. After running dcc32.exe %ERRORLEVEL% = 0.
  6. Actually I need to determine the edition of RAD Studio from an external program, from my installer program, in order to understand whether I can use dcc32.exe to compile the library source codes to generate packages for installation or not. RAD Studio 12.3 Community Edition does not support compilation via dcc32.exe. I am trying to understand how I can determine in advance in the LibInstaller program whether I can generate packages and install the library in the IDE or not.
  7. 1. RTLVersion and RAD Studio Edition (Professional, Enterprise, Community Edition) are different concepts. 2. RTLVersion for RAD Studio 12.3 cannot be called from an external program.
  8. Hello, How can I programmatically determine the edition of RAD Studio 12.3? In the registry key Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\23.0, there is no value named Edition. I have the same question regarding RAD Studio 11.3 and 10.4.
  9. Description: In Delphi, it's not possible to list units that reference each other in the interface uses section. This limitation significantly hinders class organization within a package. Initially, developers work around this by moving some unit references to the implementation uses section. However, as the class hierarchy becomes more complex, this strategy breaks down. At a certain point, class inheritance and cross-referencing between units can no longer evolve naturally due to circular reference restrictions. Instead of focusing on building a clean and scalable architecture, developers are forced to spend an excessive amount of time carefully juggling interface and implementation references across units to avoid dependency issues. Suggestion: Consider removing the concept of unit as a fundamental structural element in Delphi’s object model, and instead rely entirely on package-based architecture. Classes within the same package should be able to access each other regardless of which unit they reside in, without exposing their internal structure outside the package. If this change is too radical for Delphi’s current model, a more incremental alternative could be introduced: Allow splitting of interface/implementation code across multiple files, which could then be merged by the compiler or a preprocessor into a single internal unit. This would simulate package-level cohesion without breaking existing language design principles.
  10. "Just curious — how did you specify the calling convention cdecl? After all, DoGetValue doesn't contain any parameters for specifying the calling convention."
  11. If this issue is related to a bug in RTTI or TMemo, then a new bug report should be added to the Embarcadero Quality Portal. If this issue is related to the fact that the CaretPosition property cannot be read via RTTI, then is there a way to check this.
  12. Hello I can't figure out why the following code causes an AV error. procedure TFormSimpleDraw2.Button2Click(Sender: TObject); var Value: TValue; LType: TRttiType; RttiContext: TRttiContext; CaretPositionProp: TRttiProperty; CaretPosition: TCaretPosition; begin RttiContext := TRttiContext.Create; LType := RttiContext.GetType(Memo1.ClassInfo); CaretPosition := Memo1.CaretPosition; CaretPositionProp := LType.GetProperty('CaretPosition'); Value := CaretPositionProp.GetValue(Memo1); //AV is here end; Embarcadero® RAD Studio 12 Version 29.0.55362.2017 1. Create FMX Form. 2. Put TButton and TMemo on the Form. 3. Write TButton.OnClick as written above 4. Run and click Button
  13. Hello, Dave Thanks for the demo project. Is there a more universal way to view the list of files in Android folders? Regarding the TDirectory.GetDirectories(), TDirectory.GetFiles() methods, I noticed that the TDirectory.GetDirectories('/storage/emulated/0/') method returns a list of folders similar to what is visible in the Files by Google program. Files by Google displays files in folders such as: '/storage/emulated/0/DCIM/Camera' '/storage/emulated/0/DCIM/Screenshots' '/storage/emulated/0/Documents' '/storage/emulated/0/Download' but the TDirectory.GetFiles() method does not return any files when specifying any path. What method should be used in Android to get a list of files in a folder?
  14. Is there a Demo project in RAD Studio Samples or on github.com that demonstrates the ability to view photos in the app taken via the camera? Perhaps the TDirectory.GetFile method on Android does not work correctly or the app should request some rights via User Persmissions.
  15. TPath.GetCameraPath() returns the following value - '/storage/emulated/0/Android/data/com.embarcadero.EhLib_Fmx_MainDemo/files/DCIM'. When viewing from the program via TDirectory.GetFile, this folder does not contain files. When viewing from the phone, I cannot access the folder ‘/storage/emulated/0/Android/data/com.embarcadero.EhLib_Fmx_MainDemo’ at all.
×