调试开源工具时,HINSTANCE hinst = AfxGetInstanceHandle();这句话一直报断言错误,原因是afxCurrentInstanceHandle为NULL。
解决方案:
HINSTANCE hinst = AfxGetInstanceHandle();改为
HINSTANCE hinst = GetModuleHandle(NULL);
本文介绍了一个关于使用AfxGetInstanceHandle()函数时遇到的断言错误问题及其解决方案。该错误的原因在于afxCurrentInstanceHandle为空。文章提供了一种替代方法,即使用GetModuleHandle(NULL)来获取模块句柄。
调试开源工具时,HINSTANCE hinst = AfxGetInstanceHandle();这句话一直报断言错误,原因是afxCurrentInstanceHandle为NULL。
解决方案:
HINSTANCE hinst = AfxGetInstanceHandle();HINSTANCE hinst = GetModuleHandle(NULL);
5287

被折叠的 条评论
为什么被折叠?