Source language: Translate to:

Get Module Handle at Design Time

Questions or information that don't quite fit anywhere else

Moderator: Neosoft Support

Get Module Handle at Design Time

Postby David de Argentina » Wed Sep 29, 2010 1:57 am

Hi all,

I'm trying to bind a complete module into a plugin.

This module is added to work in design time mode.

This module has a resource file associated (icons, menus, etc).

When I call the getmodulehande("") api function, in order to get the hInstance of the plugin, I get the NeoBook handle.

If i get the
GetModuleFileName hinstance, fName, SIZEOF(fName)
api function, I get "C : \ Program Files\NeoBook 5\NeoBook.exe".

Obviously, i can't get the data stored into the resource file, because when I get
LoadImage(hInstance, "EDIT", %IMAGE_ICON, 16, 16, %LR_DEFAULTCOLOR OR %LR_SHARED)
LoadString hInstance, Nr, zT, SIZEOF(zT)

I call the NeoBook internal resource file, not the plugin internal resource file.

Any ideas ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
Posts: 1587
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Neosoft Support » Wed Sep 29, 2010 10:27 am

In Delphi the DLL's HInstance is stored in a global variable so it's not an issue there. Power Basic may have something similar. If not, look for a function called DllMain. The handle passed here is the dll's HInstance.
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5612
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Return to Misc. Questions and Information

Who is online

Users browsing this forum: No registered users and 1 guest