Page 1 of 1

Get Module Handle at Design Time

PostPosted: Wed Sep 29, 2010 1:57 am
by David de Argentina
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)
or
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

PostPosted: Wed Sep 29, 2010 10:27 am
by Neosoft Support
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.