sm女装演唱会:AfxGetInstanceHandle()

来源:百度文库 编辑:高考问答 时间:2024/05/03 00:44:10
VC里这个函数是干什么用的?

看名字就知道了,获得实例句柄。
比如获取应用程序的实例句柄,应用程序的实例句柄保存在CWinAppIm_hInstance 中,可以这么调用:
HANDLE hInstance=AfxGetInstanceHandle();

这是MSDN里面的解释,请看吧:AfxGetInstanceHandle
HINSTANCE 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

This function allows you to retrieve the instance handle of the current application. 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.