开发者

How to check which .bpl package an object belongs to

My Win32 application is built with runtime packages. We may always use HInstance as a reference to know th开发者_如何学JAVAe runtime package of current execution point for a process.

My application may load few runtime packages at runtime. Given an object, is that possible to know which runtime package (or package THandle) the object (or class) belongs to?


You can use FindClassHInstance for this, but whether it returns a package or the exe file will depend upon whether you build with runtime packages or not.

var
  instance: HMODULE;
begin
  instance := FindClassHInstance(TButton);
  Caption := GetModuleName(instance);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜