开发者

Get BPL File Name

开发者 https://www.devze.com 2022-12-09 20:10 出处:网络
From 开发者_运维百科within a BPL, is it possible to get its own file name?e.g. C:\\foo\\bar.bpl

From 开发者_运维百科within a BPL, is it possible to get its own file name? e.g. C:\foo\bar.bpl

(dynamically loaded and delphi7, if it matters)


Call GetModuleFileName. For the module handle, use SysInit.HInstance. Passing zero will give you the host EXE's file name instead, also known as ParamStr(0).


Example use of GetModuleFileName:

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

精彩评论

暂无评论...
验证码 换一张
取 消