C++怎么调用DLL函数如题,,不是VC++啊,
如题,,不是++啊,
HINSTANCE hDllInst = LoadLibrary( "c:\\msg.dll"); if(hDllInst){ typedef int (WINAPI *MSGBOX)(char *,char *); MSGBOX MsgBox = NULL; MsgBox = (MSGBOX)GetProcAddress(hDllInst, "MsgBox"); if(MsgBox) { //这里可以做你想做的事了 } FreeLibrary(hDllInst); } 如果想什么地方都能调用MsgBox,那么可以把函数指针定义成全局变量