I am writing VCL component and trying to read a bitmap image from resource of MyPackage.bpl.
In MyComponent Code,
m_pButton->Glyph->LoadFromResourceName( ::FindClassHInstance( __classid(TPSKAccountEdit)), "ID_BITMAP_1000");
At design time, everything work fine.
At runtime, I got an exception and the program crashed at LoadFromResourceName.
I found something strange.
In MyPackage,
::FindClassHInstance got 4194304
::FindHInstance got 4194304
In my .exe
HInstance got 4194304
They have the same value.
I don't get correct HInstance of MyPackage.bpl.
I don't know what is going on and how to solve this problem.
Can someone give me a suggestion?
I am using the XE10.1 Berlin C++ Builder.
MyPackage.bpl is a designtime and runtime package.
Thanks.