首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

在一个exe中调用另一个exe,第二个exe中调用AfxGetInstanceHandle() 为NULL.怎么处理?

2012-01-20 
在一个exe中调用另一个exe,第二个exe中调用AfxGetInstanceHandle() 为NULL.怎么办??在一个exe中调用另一个

在一个exe中调用另一个exe,第二个exe中调用AfxGetInstanceHandle() 为NULL.怎么办??
在一个exe中调用另一个exe,第二个exe中调用AfxGetInstanceHandle()   为NULL.怎么办??

[解决办法]
AfxGetInstanceHandle

HINSTANCE AFXAPI AfxGetInstanceHandle( );
Return Value
An HINSTANCE to the current instance of the application. If called from within a DLL linked with the USRDLL version of MFC, an HINSTANCE to the DLL is returned.

Remarks
AfxGetInstanceHandle always returns the HINSTANCE of your executable file (.EXE) unless it is called from within a DLL linked with the USRDLL version of MFC. In this case, it returns an HINSTANCE to the DLL.


[解决办法]
我在使用SkinMagicToolkit美化exe界面时需要在InitInstance()调用
VERIFY( 1 == InitSkinMagicLib(AfxGetInstanceHandle(), "Demo " , NULL,NULL ) );
但是当在网页上启动这个exe时,程序皮肤不对.
我想问问有没有别的办法,绕过这个问题.返回NULL是正确的,但是有没有别的办法?

热点排行