Jump to content

programmerdelphi2k

Members
  • Content Count

    1406
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by programmerdelphi2k

  1. programmerdelphi2k

    Win32 remote debugging broken on Windows 11 ?

    Profiles on Registry -> \HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0\RemoteProfiles try this: remote target test if any app dont block the ip/port for your tests ( "netstart -a" ... or any other tools for tests) test if any user can read/write files, etc... on disk install PAServer, let it running in a port (ex. 65000) - normally, no needs Admin computer with Delphi (the same or remote ) run Delphi, and open your app for debugging... normally, no need Admin too! define the profile: IP/Port with IP from remote target + platform run your project with debug... You should see a console window of "RMTDBG280", which will run and link to your Delphi session, so if you close this window the IDE may freeze, so you will have to close the IDE via TaskManager. when compiling the project you may see the following line in the Delphi message window: "C:\<<Delphi folder>>\PAServer32\rmtdbg280.exe -listen" NOTE: after run in debug mode, and close the app... my "RMTDBG280" console window does not close... if I close it, in the next run-debug mode my IDE froze ... 🙂 If you are unable to open the RMTDBG280 console, then it might be the reason for your frozen IDE. I installed PAServer on the same MSWindows running Delphi, and no debugging problems were found... it was possible to debug the project, even using the same 64bit desktop. scratch dir in the same pc: C:\Users\<<WIN user>>\AppData\Roaming\Embarcadero\PAServer\scratch-dir\WIn10H22-Win64Local2\Project1\...my exe + rsm files NOTE: pay attention in the taskbar with RMTDBG icon... there you can close with sucess your console!
  2. programmerdelphi2k

    Methods from Libraries (bpl or pas) in Apps??

    of course, not? *was a sarcarsm 😂
  3. programmerdelphi2k

    Why is Url an undeclared identifier here?

    I believe that "your definition" itself as a "limited elements" = 2, or be a const have "n" elements in your array, and you dont say "how many"
  4. programmerdelphi2k

    Methods from Libraries (bpl or pas) in Apps??

    We must consider all the code that is "indirectly" called in a software, because, in this way, I am only considering, and only, the code that I directly invoked! By the way, there is a lot of cloudiness here too! now imagine that a library (collection of codes - functions, procedures, types, etc...) were all incorporated into the final software, how big would it be? (even if super compression was present)... and, why then should there be a pre-analysis of the compiler and linker before the final task: creating the executable binary (standalone or not)... what is the meaning of all this? Well, just as "non-significant things" (like "comments", etc...) don't even make sense to remain in a final binary, I don't see why a piece of code that never was or would be referenced should "continue to exist" inside the software... however, as I've said before, I'm no expert or engineer to claim such an idea. it is clear that if someone can prove and demonstrate the opposite, the initial question could be closed with a golden key, however, always with reservations, because somewhere in this "infinite universe", and, "in this non-flat Earth" there will be someone who disagree and counter with other evidence to the contrary. The witch hunt is open.... wield your swords and spells. question: So is the "whole" RTL incorporated into the final binary? (no exceptions: ALL OF IT) And the VCL, too?... since there is a chain of calls between classes and interfaces.
  5. programmerdelphi2k

    Delphi 11.3 is available now!

    LSP still stopping yet... just look in "window messages (on bottom screen)" you can see the message: LSP stopped... restarting
  6. programmerdelphi2k

    Methods from Libraries (bpl or pas) in Apps??

    hi @Ian Branch by default, in my tests, the compiler "incorporate" just the code used in your final app (EXE). ex. if a unit "MyFunc.pas" have 2 procedure, and I use just 1 procedure in my code, then, we waiting that just 1 procedure (code) will be linked in our app (exe). you can test in your project, follow me: create a unit "uMyFunctions" with 2 procedures (proc and func) named "prcHelloWorld" and "fncHelloWorld" (does not matter the code executed into it ok) now, in your app, just "uses" 1 procedure, for example: "prcHelloWorld" now, build your project (creating your EXEcutable) now, open your EXE with Notepad++ (for example) and search for two procedure above... you'll find just the procedure named: "prcHelloWorld" because, "fncHelloWorld" was not used in your app! you see? unit uMyFunctions; interface procedure prcHelloWorld; function fncHelloWorld: string; implementation procedure prcHelloWorld; var LHello: string; begin LHello := 'Hey Delphi'; end; function fncHelloWorld: string; begin result := 'hello'; result := result + ' world'; end; end. type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses uMyFunctions; procedure TForm1.Button1Click(Sender: TObject); begin prcHelloWorld; // <-- just these will be in your final Executable!!! end; end.
  7. programmerdelphi2k

    How to force update to label during a loop

    I'm not intimate with the depths of MSWindows, but I think the TLabel might respond to the "CM_TEXTCHANDED" message, so you can do some checking by redrawing the control (invalidating it and resetting to the new text)
  8. I think that this is old-problem in IDE (to +/- big project)... anything, a re-RUN-IDE should ok, not?
  9. programmerdelphi2k

    Combobox1.Items.AddObject(....)

    procedure TForm1.Button3Click(Sender: TObject); var x: TObject; begin x := TObject(0); //1... // if x = nil then ShowMessage('nil') else ShowMessage('not nil'); end;
  10. programmerdelphi2k

    Combobox1.Items.AddObject(....)

    try some like this: NOTE: TObject( 0 ) = NIL type TForm1 = class(TForm) ListBox1: TListBox; Button1: TButton; Button2: TButton; Memo1: TMemo; FDMemTable1: TFDMemTable; FDMemTable1MyID: TIntegerField; FDMemTable1MyText: TStringField; procedure Button1Click(Sender: TObject); procedure ListBox1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin // 0..10 // for var i: integer := 0 to 10 do // ListBox1.AddItem('Item' + i.ToString, TObject(i)); // // FDMemTable FDMemTable1.First; // while not FDMemTable1.Eof do begin ListBox1.AddItem(FDMemTable1MyText.AsString, TObject(FDMemTable1MyID.AsInteger)); // Warning: TObject( 0 ) = nil // FDMemTable1.Next; end; end; procedure TForm1.Button2Click(Sender: TObject); var i: integer; begin { 0..10 i := (ListBox1.Count - 1); // if (i < 0) then exit; // i := random(i); // ListBox1.ItemIndex := integer(ListBox1.Items.Objects[i]); } // ------------------- // FDMemTable i := (ListBox1.Items.Count - 1); i := random(i); // Memo1.Lines.Add(i.ToString); // if (ListBox1.Items.Objects[i] = nil) then // ...Objects[ 0 ] = nil begin Memo1.Lines.Add('nil'); i := -1; // == "0" end else i := ListBox1.Items.IndexOfObject(ListBox1.Items.Objects[i]); // ListBox1.ItemIndex := i; end; procedure TForm1.ListBox1Click(Sender: TObject); begin if (ListBox1.ItemIndex > -1) then Caption := integer(ListBox1.Items.Objects[ListBox1.ItemIndex]).ToString; end; initialization ReportMemoryLeaksOnShutdown := true; end.
  11. programmerdelphi2k

    Where to turn off 'Whole words' searching?

    and more, IDE always re-save many values on Registry and setup-files on Users\...Roaming\Embarcadero same that you dont change nothing. just compare using "Beyond Compare"
  12. programmerdelphi2k

    Where to turn off 'Whole words' searching?

    here it works in RAD11.3
  13. programmerdelphi2k

    [FMX beginner] Key Handling

    for me, be VCL or FMX always I have a beep...
  14. programmerdelphi2k

    Where to turn off 'Whole words' searching?

    for me, works on re-RUN IDE! = Pay attention = "False" // not false!! in last, try "backup" your C:\Users\<<USER WINDOWS>>\AppData\Roaming\Embarcadero and delete all (any problem you have a backup to restore)
  15. programmerdelphi2k

    [FMX beginner] Key Handling

    if fact, the "BEEP" came from OS messages, not any Delphi components, like ActionList or anyother... VCL or FMX you can try "supress" all beeps using a "windows API"... NOTE: in my VCL (empty) project or FMX (empty) project... pressing ALT + any_key = BEEP!!! then, does not matter if VCL or FMX = beep always sounds implementation {$R *.fmx} uses Winapi.Windows; procedure TForm1.Action1Execute(Sender: TObject); begin Close; end; // Disable system beep SystemParametersInfo(SPI_SETBEEP, 0, nil, SPIF_SENDWININICHANGE); // Enable system beep SystemParametersInfo(SPI_SETBEEP, 1, nil, SPIF_SENDWININICHANGE);
  16. programmerdelphi2k

    Where to turn off 'Whole words' searching?

    for sure, in Registry you can do it
  17. as we can see here, the said member is in an advanced stage of discounting and returning to the said programming language, one of the most effective solutions being, in this case, changing to another . (since nothing satisfies him for a long time). On the other hand, I believe that the real problem is your own inability from the beginning of your project, perhaps mistakes after mistakes that were circumvented at a high price at every moment. I think the most sensible thing would be to review all the code (something that may take a lot of time and resources, but necessary at this stage). As it may not be something very viable at this point in the championship, so it's more comfortable to blame the programming language... (of course, Embarcadero is very much to blame, no doubt.... but that's the life of a programmer)
  18. programmerdelphi2k

    How to force update to label during a loop

    why not use "message" to force redraw?
  19. programmerdelphi2k

    Assign an event at run time??

    type TYourTypeName = {reference to } procedure(Sender: TObject; Field: TField) { of object} ; ... your classs Private FYourEvent :TYourTypeName; ... Public property YourEvent:TYourTypeName read FYourEvent write FYourEvent; ... // "reference to" if using regular procedure procedure HelloWorld(Sender: TObject; Field: TField); ... // else, using a procedure "of object" TForm1.... class ... Private procedure HelloWorld(Sender: TObject; Field: TField); ... // Assigning // into class FYourEvent := HelloWord-proc; // in your code YourEvent := HelloWord; ... // executing if Assigned( FYourEvent ) then FYourEvent( obj, fld ); // It would be this? // as you are using in 2 apps, you can use "Compiler Directives", or any other way ... {$DEFINE APP1} ... {$IFDEF APP1} ... {$ELSE} ... {$ENDIF}
  20. I think that "Format C:" It's faster, isn't it? 😂 😂 😂
  21. programmerdelphi2k

    VCL and VCL styles - bugs and future

    I said that a book is better than a post.
  22. programmerdelphi2k

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

    Hello VCL world... type TForm1 = class(TForm) Image1: TImage; ImageBackground: TImage; procedure FormCreate(Sender: TObject); procedure FormKeyPress(Sender: TObject; var Key: Char); procedure FormDestroy(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} var LStep : integer = 5; LHelloArray: array [0 .. 2] of TBitmap; procedure MyLoadHello; begin LHelloArray[0] := TBitmap.Create; LHelloArray[1] := TBitmap.Create; LHelloArray[2] := TBitmap.Create; /// LHelloArray[0].LoadFromFile('..\..\Hello.bmp'); LHelloArray[1].LoadFromFile('..\..\Hello_Left.bmp'); LHelloArray[2].LoadFromFile('..\..\Hello_Right.bmp'); end; procedure MyDestroyHello; begin for var i: integer := 0 to high(LHelloArray) do FreeAndNil(LHelloArray[i]); end; procedure MoveMyHello(const AKey: Char; const AImage: TImage); var ALeft, ATop: integer; begin if (AKey = '') or (AImage = nil) then exit; // ALeft := AImage.Left; ATop := AImage.Top; // case AKey of 'a', 'q', 'z', 'A', 'Q', 'Z': AImage.Picture.Bitmap := LHelloArray[1]; // left 'd', 'e', 'c', 'D', 'E', 'C': AImage.Picture.Bitmap := LHelloArray[2]; // right else AImage.Picture.Bitmap := LHelloArray[0]; // default end; // case AKey of 'a', 'A': ALeft := ALeft - LStep; 'd', 'D': ALeft := ALeft + LStep; 'w', 'W': ATop := ATop - LStep; 's', 'S': ATop := ATop + LStep; 'q', 'Q': begin ALeft := ALeft - LStep; ATop := ATop - LStep; end; 'e', 'E': begin ALeft := ALeft + LStep; ATop := ATop - LStep; end; 'z', 'Z': begin ALeft := ALeft - LStep; ATop := ATop + LStep; end; 'c', 'C': begin ALeft := ALeft + LStep; ATop := ATop + LStep; end; end; // AImage.Left := ALeft; AImage.Top := ATop; end; procedure TForm1.FormCreate(Sender: TObject); begin Self.KeyPreview := true; // all keys processed by form... // ImageBackground.Picture.LoadFromFile('..\..\background.bmp'); // MyLoadHello; // Image1.Stretch := true; Image1.Transparent := true; // to BMPs Image1.Picture.Bitmap := LHelloArray[0]; end; procedure TForm1.FormDestroy(Sender: TObject); begin MyDestroyHello; end; procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); begin MoveMyHello(Key, Image1); end; end.
  23. Of course, this way is not the last word in organizational technology, however, for simpler scenarios, where we always have to be aware that the project can be used in more than one IDE, then I think it helps a lot! NOTE: in fact, I just only follow the basic idea in Delphi IDE projects, as you see almost all company distribute many folders, one for each DPK IDE. in fact, you dont need copy all project at all... just create a new DPR file and add the units references into, and "paths" necessary!
  24. Regarding the project file, I think it would be more appropriate to have each project for all the IDEs you use. For example, if the project started with Delphi7, and now you are using RAD11.3, then you could keep the project files separate. Each in its own folder. In this way, you would simply add the units/forms in the *.dpr files, and, in theory, you would solve this infamous impasse. this is my way: projectMyDelphiIsCrazy all_units_forms_from_the_project Delphi7_DPR_setup RAD113_DPR_setup etc...
  25. programmerdelphi2k

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

    if key is a char: if Key in ['W','w'] then.... if Lower(key) = 'w' then... if key is a Word: if char(key) in ['W', 'w'] then...
×