Hi, this code in the project home page is simple, but I think it can't be compiled. This is what I used for my project:
// Load the DLL
HMODULE hModule = LoadLibrary(L"exchndl.dll");
if(hModule != NULL)
{
// Get the function pointer
FARPROC pfnExcHndlInit = GetProcAddress(hModule, "ExcHndlInit");
if(pfnExcHndlInit != NULL)
{
// Declare the function pointer type
typedef void (*ExcHndlInitFunc)();
// Cast the function pointer
ExcHndlInitFunc pfnInit = reinterpret_cast<ExcHndlInitFunc>(pfnExcHndlInit);
// Call the function
pfnInit();
}
else
{
// Handle the error if GetProcAddress fails
// Add your error handling code here
}
// Free the DLL module, actually we do not free the dll, so we can got the call stack RPT(report file)
// FreeLibrary(hModule);
}
else
{
// Handle the error if LoadLibrary fails
// Add your error handling code here
}
Hi, this code in the project home page is simple, but I think it can't be compiled. This is what I used for my project:
Hope that helps.