Article ID: 115088
Article Last Modified on 11/21/2006
// Compile options needed: /D "_USRDLL"
#include <afxwin.h>
BOOL AFXAPI MyInit(HINSTANCE);
extern "C" int FAR PASCAL LibMain(HINSTANCE hInstance,
WORD wDataSegment, WORD wHeapSize, LPSTR lpszCmdLine)
{
// Initialize DLL's instance(/module) not the app's
if (!MyInit(hInstance))
{
return 0; // Init Failed
}
// nothing to run
return 1; // ok
}
BOOL AFXAPI MyInit(HINSTANCE hInstance)
{
afxCurrentInstanceHandle = hInstance;
afxCurrentResourceHandle = hInstance;
// one instance initialization stuff goes here
// Handle critical errors
::SetErrorMode(SEM_FAILCRITICALERRORS);
return TRUE;
}
// Compile options needed: /D "_USRDLL"
#include <afxwin.h>
BOOL AFXAPI MyInit(HINSTANCE);
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
// Initialize DLL's instance(/module) not the app's
if (!MyInit(hInstance))
{
return 0; // Init Failed
}
}
return 1; // ok
}
BOOL AFXAPI MyInit(HINSTANCE hInstance)
{
afxCurrentInstanceHandle = hInstance;
afxCurrentResourceHandle = hInstance;
// one instance initialization stuff goes here
// Handle critical errors
::SetErrorMode(SEM_FAILCRITICALERRORS);
return TRUE;
}
Additional query words: 1.00 1.50 2.00 2.10 2.50 4.00
Keywords: kbdll kbprb KB115088