$ImageBase Compiler Directive


{$ImageBase Integer}




The image base is the address at which Windows loads a module. The default image base is $00400000, which is the Windows default. You don’t need to change this for programs, but you should change it for libraries and packages.

Windows must load every module at a unique address. It tries to load the module at the image base address, but if that address conflicts with another module in the same process, Windows must relocate the module to a different virtual address. Relocating increases the time needed to load a module.

Delphi’s standard packages use image bases starting at $40000000. Microsoft system DLLs start at $70000000. There are no standards for third-party packages and DLLs, so do your best to choose addresses that do not conflict.

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.