加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

winapi – 如何从DLL获取HINSTANCE?

发布时间:2020-12-13 20:15:15 所属栏目:Windows 来源:网络整理
导读:我在VC中创建了一个DLL作为Win32项目 DLLMAIN函数是 BOOL APIENTRY DllMain( HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved ){ return TRUE;} 现在我需要HINSTANCE的DLL,需要传递给Win32函数. HMODULE和HINSTANCE是否相同? 如何获得HINSTANC
我在VC中创建了一个DLL作为Win32项目

DLLMAIN函数是

BOOL APIENTRY DllMain( HMODULE hModule,DWORD  ul_reason_for_call,LPVOID lpReserved
                     )
{
    return TRUE;
}

现在我需要HINSTANCE的DLL,需要传递给Win32函数.

HMODULE和HINSTANCE是否相同?

如何获得HINSTANCE?

本书摘自Windows Via C/C++ [1]

Note As it turns out,HMODULEs and HINSTANCEs are exactly the same thing. If the documentation for a function indicates that an HMODULE is required,you can pass an HINSTANCE and vice versa. There are two data types because in 16-bit Windows HMODULEs and HINSTANCEs identified different things

[1] Richter,Jeffery和Nasarre,Christophe,Windows Via C/C++,5th ed,Redmond:Microsoft Press 2008,pp.74

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读