.exe HINSTANCE problem
Posted on 1997-10-16
I am using VC++ 4.0 on 95.
Here's a description of the problem. There is a function in my .exe that I need to access in one of my .dlls. I want to export the Instance Handle of the .exe to a .dll in order to access the function from the .exe in the .dll.
I have set up an exported function in my .dll and use this and the AfxGetInstanceHandle function in the .exe to pass the HINSTANCE of the .exe to the .dll. BUT it consistently passes a value of 0x00400000 to the .dll. When I attempt to use this HINSTANCE value in the .dll with the GetProcAddress function nothing happens. I used GetLastError() and got an error code of 126 which is "The specified module cannot be found".
Sorry about the long-winded description but this is all new territory to me and it has me stumped.
Cheers - Rodger.