相关代码 |
|
#include #define EXPORT __declspec(dllexport) typedef void(*FnPtrT)(); int main() { HMODULE hDll = ::LoadLibrary("ImportingDLL.dll"); if(!hDll) { MessageBox(NULL,"DLL Not Found : ImportingDLL.dll","From Exe",MB_OK); } else { FnPtrT FnPtr = (FnPtrT)::GetProcAddress(hDll,"fnImportingDLL"); if(FnPtr) (*FnPtr)(); ::FreeLibrary(hDll); } return 0; } extern "C" { EXPORT void ExeFn(char * lpszMessage) { MessageBox(NULL,lpszMessage,"From Exe",MB_OK); } }
相关资源 |
|