52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
|
|
// ServerControl.cpp : <20><><EFBFBD><EFBFBD> DLL <20>ij<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>̡<EFBFBD>
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
#include "stdafx.h"
|
|||
|
|
#include <afxdllx.h>
|
|||
|
|
#include "ServerControlItemSink.h"
|
|||
|
|
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
#define new DEBUG_NEW
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
static AFX_EXTENSION_MODULE ServerControlDLL = { NULL, NULL };
|
|||
|
|
|
|||
|
|
extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> lpReserved<65><64><EFBFBD>뽫<EFBFBD><EBBDAB><EFBFBD>Ƴ<EFBFBD>
|
|||
|
|
UNREFERENCED_PARAMETER(lpReserved);
|
|||
|
|
|
|||
|
|
if (dwReason == DLL_PROCESS_ATTACH)
|
|||
|
|
{
|
|||
|
|
TRACE0("ServerControl.DLL <20><><EFBFBD>ڳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>\n");
|
|||
|
|
if (!AfxInitExtensionModule(ServerControlDLL, hInstance)) return 0;
|
|||
|
|
new CDynLinkLibrary(ServerControlDLL);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else if (dwReason == DLL_PROCESS_DETACH)
|
|||
|
|
{
|
|||
|
|
TRACE0("ServerControl.DLL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9>\n");
|
|||
|
|
AfxTermExtensionModule(ServerControlDLL);
|
|||
|
|
}
|
|||
|
|
return 1; // ȷ<><C8B7>
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
extern "C" __declspec(dllexport) void * __cdecl CreateServerControl()
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
CServerControlItemSink * pServerControl = NULL;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
pServerControl = new CServerControlItemSink();
|
|||
|
|
if (pServerControl == NULL)
|
|||
|
|
throw TEXT("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>");
|
|||
|
|
|
|||
|
|
return pServerControl;
|
|||
|
|
}
|
|||
|
|
catch (...) {}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
SafeDelete(pServerControl);
|
|||
|
|
return NULL;
|
|||
|
|
}
|