Get BPL File Name

Can I get my own file name inside BPL? e.g. C: \ Foo \ bar.bpl

(dynamically loaded and delphi7, if that matters)

+4
source share
2 answers

Call GetModuleFileName . For the module descriptor, use SysInit.HInstance . When going to zero, instead, you get the EXE host name, also called ParamStr(0) .

+8
source

An example of using GetModuleFileName:

 function DLLFileName : string; begin SetLength(Result,MAX_PATH); GetModuleFileName(HInstance,PCHar(Result),MAX_PATH); SetLength(Result,StrLen(PChar(Result))); end; 
+1
source

All Articles