Jump to content

programmerdelphi2k

Members
  • Content Count

    1406
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by programmerdelphi2k

  1. programmerdelphi2k

    Beginner to Delphi. Have no idea what I'm doing wrong here

    1) pay attention on "param type", in case: "KEY = WORD type", or be, "a number" not a "letter" Byte, Word, SmallInt, Integer, Double, etc.. = numberic value string, char, shortstring, etc.. = character value (number, letter, symbol quoted) 2) if you need that a "control" stay on focus in your form, try use property "ActiveControl" on form (in design-time or runtime) too! no need a coding, at all.
  2. @Rollo62 if the project is from old-IDE, did you try delete all files created by IDE, like *.dproj, and *.res etc... and building under RAD11.3? sometimes I do the (crazy) tests, like: backup a folder or files, when all is out-control, you see, and.... delete all files (in project) created by IDE c:\users\...\"Embarcadero" <-- and delete all, and run my IDE again etc... new fresh files!!! sometimes works, sometimes not! but dont worry, I has my "restore-files"
  3. programmerdelphi2k

    Delphi 11.3 - Android 13 - Fail deploy of all projects

    try delete all folder/files (including Android.Manifest.xml) created by Delphi when build/compile and try re-build ALL again! your error talk about "android:exported" not defined!!! look here: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Android_Service
  4. programmerdelphi2k

    Code Insight index location to ram disk?

    no, what was the "LSP" folder used in your command-line? can you show your command-line?
  5. programmerdelphi2k

    Code Insight index location to ram disk?

    how do you did with this scenary? (command-line?)
  6. programmerdelphi2k

    Creating FMX controls in a background thread

    @Remy Lebeau As MSWin is the basis for WinControls, then, I thought that it was "he who created the objects, in fact" (and "Create by Delphi" was just a memory allocator, use see?), and... only later, these objects were offered to Delphi, in this case! Hence, my doubt about who really was the "primary owner" of the object... But thanks anyway!
  7. programmerdelphi2k

    Code Insight index location to ram disk?

    did you try this: re-direct the "original" folder where LSP store its file to your RAM-drive? in MSWin10 I use "MKLink" in my "saves-original-folder ... in games", then, all files will be stored (save) in another disk/folder" mklink /d /j "c:\folder_source" "d:\my_target" // d=directory j=junction == Symbolic link
  8. programmerdelphi2k

    Code Insight index location to ram disk?

    did you try change to "Classic" mode? in Help say that you can create a "New" LSP setup, did you see this? in Registry, you can change some definitions, did you see this? Filing Bugs and Log Files https://docwiki.embarcadero.com/RADStudio/Sydney/en/Code_Insight_Reference
  9. programmerdelphi2k

    I need help with TRestRequest!

    Is not possible try in RestDebugger? (it create your compinents with all properties...) later, just copy for your form and see what was done
  10. programmerdelphi2k

    bitmap is not displayed

    some like this...? (from CodeProject in C sources) in Delphi procedure TForm1.Button3Click(Sender: TObject); var LScreenWidth : Integer; LScreenHeigth : Integer; LHWndDesktop : HWND; LHDCDesktop : HDC; LHDCCapture : HDC; LHBitmapCapture: HBITMAP; begin LHWndDesktop := 0; LHDCDesktop := 0; LHDCCapture := 0; LHBitmapCapture := 0; try // maybe it's better verify if ( HDCxxxx > 0) then ... LScreenWidth := GetSystemMetrics(SM_CXSCREEN); // screen sizes LScreenHeigth := GetSystemMetrics(SM_CYSCREEN); // LHWndDesktop := GetDesktopWindow; LHDCDesktop := GetDC(LHWndDesktop); // LHDCCapture := CreateCompatibleDC(LHDCDesktop); LHBitmapCapture := CreateCompatibleBitmap(LHDCDesktop, LScreenWidth, LScreenHeigth); // SelectObject(LHDCCapture, LHBitmapCapture); BitBlt(LHDCCapture, 0, 0, LScreenWidth, LScreenHeigth, LHDCDesktop, 0, 0, SRCCOPY {or CAPTUREBLT} );// Image1.Picture.Bitmap.Handle := LHBitmapCapture; // just get the handle of this object... // storing in some place (disk, memory,etc...) to load later... // Image1 is TImage just show on form tests... Image1.Picture.Bitmap.SaveToFile('bmptemp.bmp'); Image1.Picture.Bitmap.LoadFromFile('bmptemp.bmp'); finally ReleaseDC(LHWndDesktop, LHDCDesktop); DeleteDC(LHDCCapture); DeleteObject(LHBitmapCapture); // this destroy the LHBitmapCapture (reference) above! end; end;
  11. programmerdelphi2k

    bitmap is not displayed

    and Tezeus ran, ran, fleeing the labyrinth and the Minitaurus... however, he found Medusa on his way out, and petrified to death.
  12. programmerdelphi2k

    Creating FMX controls in a background thread

    ok thanks
  13. programmerdelphi2k

    Creating FMX controls in a background thread

    thanks @Dalija Prasnikar Ok, but if we use "Create" from Delphi, as it is the default and widely used for this task, and... Delphi calls (uses) the class of this control defined in MSWindows, for example, TEdit uses the definitions from the MSWindows Edit control, so aren't we actually calling a task defined in MSWindows and transferring its owner to Delphi? ... that is, an OS API thread (performs the actions of a lower level) transfers to a thread (main) in Delphi (of a higher level)... isn't that what happens? I don't know if I managed to explain my train of thought...
  14. programmerdelphi2k

    Creating FMX controls in a background thread

    A question about a doubt that torments me sometimes: if visual controls are inherited from the operating system (the parent classes), at its core, and used by Delphi in its pertinent classes, like TEdit(... TWinControl), after all: Which thread actually creates the visual control (i.e. the object used by Delphi), the MSWindows API or the pseudo class in Delphi? And, if the final object (if it comes from AP Windows) is created by the OS, and then perfected by Delphi (in its pertinent classes), there would not be a transfer of "ownership" between the threads of the operating system and the thread Delphi application main? Another thing: if basically everything comes via message from the operating system, and intercepted by the application (thread main) Delphi, a very tight semaphore could really degrade future actions in the interface, no?
  15. programmerdelphi2k

    TNumberBox and scientific notation (exponential format)

    maybe some like this ??? NOTE: when replace a value on NumberBox (old values) was verifyed that "e" will be accepted!!! then needs more tests... ok? NOTE2: NumberBox1.Text is always "old value", better works to "NumberBox1.VALUExxxxx" type TForm1 = class(TForm) NumberBox1: TNumberBox; procedure FormCreate(Sender: TObject); private procedure MyOnValidChar(AChar: char; var AValidated: boolean); public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; // NumberBox1.Mode := TNumberBoxMode.nbmFloat; NumberBox1.Decimal := 20; // ?? NumberBox1.DisplayFormat := '0.0E+;0.0E-;Hello'; // NumberBox1.OnValidateChar := MyOnValidChar; // <------ end; procedure TForm1.MyOnValidChar(AChar: char; var AValidated: boolean); begin if CharInSet(AChar, ['E', 'e']) then begin if NumberBox1.ValueFloat = 0 then // eNNNN.NNN ??? AValidated := false else AValidated := string(NumberBox1.Text).ToLower.CountChar('e') = 0; // NOT "Neeee" end; end;
  16. programmerdelphi2k

    Panels and alignment

    I think that my first sample it's good and simple, just using basic idea with "obj containers". Using "FlowPanel", it's not so wrong... but I think that "it" it's not for this tasks... but if OP want more coding then both would can do it! (not necessary so easy using FlowPanel)
  17. programmerdelphi2k

    Panels and alignment

    really, I dont see "ControlIndex" helping in this task... try expand/colapse the "FlowPanel" as my sample above and see the real resulted... 😩 no no no! now, if you need just "hide/show" then, any other "container with many panels" do it, not? (be Panel, FlowPanel, Rectangles, etc...
  18. programmerdelphi2k

    Memory Leak after FireDAC loses DB connection

    there are many variants to think about: do you try to "close" the FDQry when "lost connection" is noticed? if, your FDQry are being used to run tasks on threads, for example? ...threads need to be notified in case of connection loss and stop any actions related to them!
  19. programmerdelphi2k

    TNumberBox and scientific notation (exponential format)

    maybe....
  20. this can help you? https://github.com/viniciussanchez/dataset-serialize Sample: https://raw.githubusercontent.com/viniciussanchez/dataset-serialize/master/img/img-02.png
  21. programmerdelphi2k

    Error loading data???

    Normally, I delete all "Wellcome... .BPL" references on Registry on "[HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0\Known IDE Packages]" ... I HATE THIS PLUGIN!!! 😂 you can try just use "-np" param on BSD.exe command-line too!
  22. programmerdelphi2k

    Change TRibbon Style

    did try this https://stackoverflow.com/questions/67764080/delphi-change-ribbon-menu-color-when-vcl-theme-is-applied
  23. programmerdelphi2k

    FireDAC MSSQL behaviour changed between 11.1 and 11.3

    maybe... because is waiting for a "IP" address as show the "ip.ad.dr.es" mask = nnn.nnn.nnn.nnn not?
  24. programmerdelphi2k

    The best way to handle undo and redo.

    I think that in a multiuser environment or even in "multiple read and write concurrency", this would not be a sensible thing to do!!!! You would need to "lock" the entire database to make sure you actually completed what you wanted to do! Who could perform the task? What task would be wanted at the end of it all? And, if the first task was desirable, however, another one was carried out at the end of it all? This situation is very complicated!!! I think it's too much of a headache for data engineers to implement an incremental "backup/restore" with the database online, isn't it? Now, imagine deciding which data in a record will be effectively recorded after thousands of requests? In a more simplistic way, perhaps create a specific table to receive the "logs" (a kind of "historical table: time, recordID, record-fields-values, etc...") of records from "a table" that want to do such a task, it could be a little easier... or not! now imagine that this history-table receives thousands of entries per second... isn't it complicated?
  25. programmerdelphi2k

    TStringGrid ComboBox not updating dataset

    other way is using the "var Control" param on "CreateCustomEditor" event: implementation {$R *.fmx} function fncMyComboBox: TComboBox; // my Control used in my TGrid-CustomEditor... begin // it will be "created"... and "destroyed by Grid" result := TComboBox.Create(nil); // result.Items.AddStrings(['One', 'Two', 'Three']); // result.OnChange := Form1.MyComboBoxChange; end; procedure TForm1.MyComboBoxChange(Sender: TObject); begin if not(Sender is TComboBox) then exit; // try BindSourceDB1.DataSet.Edit; BindSourceDB1.DataSet.FieldByName('MyId').Value := TComboBox(Sender).Selected.Index; BindSourceDB1.DataSet.Post; except // ??? end; end; procedure TForm1.Grid1CreateCustomEditor(Sender: TObject; const Column: TColumn; var Control: TStyledControl); begin if (Column.Index = 0) then Control := fncMyComboBox; // who's the "destroyer" now? end; initialization ReportMemoryLeaksOnShutdown := true; // any memory leaks? end.
×