开发者

How to check which .bpl package an object belongs to

开发者 https://www.devze.com 2023-01-26 20:31 出处:网络
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 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

精彩评论

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