Print Page | Close Window

AfxGetInstanceHandle() fails

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=8603
Printed Date: 26 June 2024 at 2:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: AfxGetInstanceHandle() fails
Posted By: dhansen
Subject: AfxGetInstanceHandle() fails
Date Posted: 30 October 2007 at 12:57pm
I am accessing the SkinFramework dll from another MFC dll. When I call LoadSkin() I get an assert because AfxGetInstanceHandle() fails. If I put  AFX_MANAGE_STATE(AfxGetStaticModuleState()) at the top of the method that calls LoadSkin() the assert goes away, but will retrieve the handle to my module rather than the SkinFramework dll.

This seems like a serious issue because the code is trying to apply the API hook when windows API functions are called within various modules in the process except for the SkinFramework.dll. SkinFrameWork will never retrieve the correct module handle because there is no call to AFX_MANAGE_STATE in the skin framework code.





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net