【发布时间】:2012-10-29 23:42:42
【问题描述】:
好的,我的简单 DLL Hellow World 函数
#include "stdafx.h"
extern "C" void HelloWorld()
{
MessageBox( NULL, TEXT("Hello World"),
TEXT("In a DLL"), MB_OK);
}
我的简单 hello world 应用没有调用:
case IDM_ABOUT:
hinstDLL = LoadLibrary(L"phantasyhook.dll");
if (hinstDLL != NULL)
{
HelloWorld = (FARPROC) GetProcAddress(hinstDLL, "HelloWorld");
if (HelloWorld != NULL)
HelloWorld();
else
MessageBox(NULL, L"is null", L"dll Error", MB_OK);
FreeLibrary(hinstDLL);
}
break;
它打开“is null”消息框,认为它应该打开 Hello World 消息框。我做错了什么?
【问题讨论】:
-
我相信你错过了
__declspec(dllexport)