LoadLibrary;HINSTANCE hDll=GetModuleHandle("Win32_2.dll");
2012-12-24 09:28
399 查看
HINSTANCE g_hDll=NULL; void CCallerDlg::OnBtnLoad() { // TODO: Add your control notification handler code here g_hDll=LoadLibrary("..\\..\\Debug\\Win32_2.dll"); } void CCallerDlg::OnBtnUnload() { // TODO: Add your control notification handler code here if(g_hDll) { FreeLibrary(g_hDll); g_hDll=NULL; } } void CCallerDlg::OnBtnGetmodule() { // ZwCreateKey = (_ZwCreateKey *) GetProcAddress(GetModuleHandle(L"ntdll.dll"), "ZwCreateKey"); /* (1) 动态调用:typedef int(*lpAddFun)(int, int); //宏定义函数指针类型 lpAddFun add;//函数指针 HINSTANCE hDll=LoadLibrary(“path”); add=(lpAddFun)GetProcAddress(hDll, "add");//获得dll中的add函数指针 FreeLibrary(hDll); */ HINSTANCE hDll=GetModuleHandle("Win32_2.dll"); char buff[256]="hDll!=g_hDll"; if(hDll==g_hDll ) sprintf(buff,"hDll=g_hDll"); char buff2[256]; sprintf(buff2,"hDll:%d;g_hDll:%d",hDll,g_hDll); MessageBox(buff2,buff); }
相关文章推荐
- GetModuleHandle("qq.dll");hDll_debug2=LoadLibrary("..\\qq\\Debug\\qq.dll");
- GetModuleHandle和AfxGetInstanceHandle和CWinApp->m_hInstance的区别
- GetModuleHandle和AfxGetInstanceHandle和CWinApp->m_hInstance的区别
- Win7下使用VS2013编写的ActvieX在XP下注册提示:LoadLibrary("XXX.dll")失败-找不到指定的程序
- GetModuleHandle(NULL)获取当前DLL模块基址?
- GetModuleHandle(NULL)获取当前DLL模块基址?
- Win7下使用VS2013编写的ActvieX在XP下注册提示:LoadLibrary("XXX.dll")失败-找不到指定的程序
- LoadLibrary("msxml.dll")失败,动态链接库(DLL)初始化例程失败。
- [C++] GetModuleHandle 调用dll
- 解决"Access volidate address in module "midas.dll"
- LoadLibrary和GetModuleHandle的区别
- WinAPI: GetModuleHandle - 获取一个模块(exe 或 dll)的句柄
- LoadLibrary 和 GetModuleHandle
- <Win32 API> 获取系统文件夹路径 GetModuleFileName
- 对LoadLibrary和GetModuleHandle的一些东西
- LoadLibrary("TestOCX.ocx") failed-The specified module could not be found
- API太多(C++版) -- GetModuleHandle LoadLibrary GetProcAddress 讲解
- LoadLibrary("TestOCX.ocx") failed-The specified module could not be found
- LoadLibrary和GetModuleHandle的区别
- 对GetModuleHandle和LoadLibrary的一些理解以及壳中的重定位的一些理解