How do you extract local variable information (address and type) from a Delphi program or the compiler-generated debug info?

Check if any debugging symbols weren’t in binary. Also possible is using GDB (on Windows a port of it). It would be great if you found a .dbg or .dSYM file. They contain source code, eg. gdb> list foo 56 void foo() 57 { 58 bar(); 59 sighandler_t fnc = signal(SIGHUP, SIG_IGN); 60 raise(SIGHUP); 61 … Read more

How do I include a newline character in a string in Delphi?

In the System.pas (which automatically gets used) the following is defined: const sLineBreak = {$IFDEF LINUX} AnsiChar(#10) {$ENDIF} {$IFDEF MSWINDOWS} AnsiString(#13#10) {$ENDIF}; This is from Delphi 2009 (notice the use of AnsiChar and AnsiString). (Line wrap added by me.) So if you want to make your TLabel wrap, make sure AutoSize is set to true, … Read more

How do I make my GUI behave well when Windows font scaling is greater than 100%

Your settings in the .dfm file will be scaled up correctly, so long as Scaled is True. If you are setting dimensions in code then you need to scale them by Screen.PixelsPerInch divided by Form.PixelsPerInch. Use MulDiv to do this. function TMyForm.ScaleDimension(const X: Integer): Integer; begin Result := MulDiv(X, Screen.PixelsPerInch, PixelsPerInch); end; This is what … Read more

Are delphi variables initialized with a value by default?

Yes, this is the documented behaviour: Object fields are always initialized to 0, 0.0, ”, False, nil or whatever applies. Global variables are always initialized to 0 etc as well; Local reference-counted* variables are always initialized to nil or ”; Local non reference-counted* variables are uninitialized so you have to assign a value before you … Read more

Find out what process registered a global hotkey? (Windows API)

One possible way is to use the Visual Studio tool Spy++. Give this a try: Run the tool (for me, it’s at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\spyxx_amd64.exe or you can download it). Note: there is spyxx.exe (32-bit version) and spyxx_amd64.exe (64-bit version) – if you don’t see anything in 64-bit use the 32-bit version (ie.catches … Read more

How to create “No Activate” form in Firemonkey

It is possible using NSPanel with NSNonactivatingPanelMask flag. The NSView of fmx form should become child of NSPanel. I have written a helper class which works for both Windows and Mac platforms (Works on XE4): unit NoActivateForm; interface uses Fmx.Forms, Fmx.Types {$IFDEF POSIX} , Macapi.AppKit {$ENDIF} ; type TNoActivateForm = class private form: TForm; {$IFDEF … Read more

SOAP server and client application VCL+indy demo for Delphi XE?

I have posted the complete set of demos for SOAP on CodeCentral as item 28789. These contain every single one of the Delphi 2007 era SOAP demos from the WebServices folder, now updated for Delphi XE and XE2, including converting the old WAD servers into new INDY VCL servers. You’d think that was impressive, except … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)