Delphi Programming

Detecting DLL Filename

2,919pages on
this wiki
Add New Page
Talk0 Share

How to detect the full path and file name of where the DLL was called from.

uses Windows;
procedure ShowDllPath stdcall;
  TheFileName : array[0..MAX_PATH] of char;
 FillChar(TheFileName, sizeof(TheFileName), #0);
 GetModuleFileName(hInstance, TheFileName, sizeof(TheFileName));
 MessageBox(0, TheFileName, 'The DLL file name is:', mb_ok);

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.