Delphi: How to hide ancestor constructors?

If I remember correctly, then reintroduce should help for virtual methods. The reintroduce directive suppresses compiler warnings about hiding previously declared virtual methods. Use reintroduce when you want to hide an inherited virtual method with a new one. To answer your updated question – I think it’s not possbile to hide a non-virtual constructor with … Read more

Creating Accessible UI components in Delphi

The VCL itself does not natively implement any support for MSAA. Windows provides default implementations for standard UI controls, which many standard VCL components wrap. If you need more MSAA support than Windows provides, you will have to implement the IAccessible interface yourself, and then have your control respond to the WM_GETOBJECT message so it … Read more

Patch routine call in delphi

I use the following code: procedure PatchCode(Address: Pointer; const NewCode; Size: Integer); var OldProtect: DWORD; begin if VirtualProtect(Address, Size, PAGE_EXECUTE_READWRITE, OldProtect) then begin Move(NewCode, Address^, Size); FlushInstructionCache(GetCurrentProcess, Address, Size); VirtualProtect(Address, Size, OldProtect, @OldProtect); end; end; type PInstruction = ^TInstruction; TInstruction = packed record Opcode: Byte; Offset: Integer; end; procedure RedirectProcedure(OldAddress, NewAddress: Pointer); var NewCode: TInstruction; … Read more

Accessing protected event of TWinControl

You don’t need RTTI. Any code has implicit access to the protected members of any class declared in the same unit. You can take advantage of this by declaring a new TWinControl descendant in the unit that needs access to that class’s members. The declaration is very simple: type TProtectedWinControl = class(TWinControl); Then type-cast any … Read more

WWW server reports error after POST Request by Internet Direct components in Delphi

I’m very sure that I’m POSTing the right data Since it does not work – obviously you do not (or Delphi does not – that makes no difference for server). You should start usual debugging loop: Observe reference working behaviour. Observe your program behavior Spot the difference Eliminate the difference Check if the program works … Read more

My program never releases the memory back. Why?

Task Manager is not the right tool to detect memory leaks. Delphi allocates large blocks of memory and keeps them later for future use, so certain increase in allocated memory is expected even after you release all resources. Any other results (and more detailed answers) can be obtained only by using specialize memory analysis tools. … Read more