Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

Can Someone explain me how to use AfxGetInstanceHandle() inside a DLL (Dialog based MFC Application as a DLL)?

It returns NULL value all the time, but somehow It works in Release mode, I have no idea how to use this properly.

Please advice.


Thanks
Sutha
Posted

1 solution

To sucessfully get the Instance value the dll file needs to linked with USRDLL version of MFC.
I guess you are having different project settings for debug and release version and that causing the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900