72 lines
1.5 KiB
C++
72 lines
1.5 KiB
C++
#include "StdAfx.h"
|
|
#include "resource.h"
|
|
#include <afxdllx.h>
|
|
|
|
void InitApplication();
|
|
void UnloadApplication();
|
|
|
|
HINSTANCE _hdllInstance =NULL ;
|
|
|
|
AC_IMPLEMENT_EXTENSION_MODULE(AdsXRx);
|
|
|
|
extern "C"
|
|
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
|
|
{
|
|
if (dwReason == DLL_PROCESS_ATTACH)
|
|
{
|
|
_hdllInstance = hInstance;
|
|
AdsXRx.AttachInstance(hInstance);
|
|
}
|
|
else if (dwReason == DLL_PROCESS_DETACH)
|
|
{
|
|
AdsXRx.DetachInstance();
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
extern "C" AcRx::AppRetCode
|
|
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
|
|
{
|
|
switch (msg)
|
|
{
|
|
case AcRx::kInitAppMsg:
|
|
acrxDynamicLinker->unlockApplication(pkt);
|
|
acrxDynamicLinker->registerAppMDIAware(pkt);
|
|
InitApplication();
|
|
break;
|
|
case AcRx::kUnloadAppMsg:
|
|
UnloadApplication();
|
|
break;
|
|
}
|
|
return AcRx::kRetOK;
|
|
}
|
|
|
|
extern void InitDbText(BOOL bTrue);
|
|
extern void IniAecDbSheet(BOOL bTrue);
|
|
extern void InitDbBlockInsert(BOOL bTrue);
|
|
extern void InitDbSymbolAnnotate(BOOL bTrue);
|
|
extern void InitEntity(BOOL bTrue);
|
|
extern void InitCurveEntity(BOOL bTrue);
|
|
extern void InitDbPolyCurveEnt(BOOL bTrue);
|
|
|
|
void InitApplication()
|
|
{
|
|
InitEntity(TRUE);
|
|
InitCurveEntity(TRUE);
|
|
InitDbText(TRUE);
|
|
IniAecDbSheet(TRUE);
|
|
InitDbBlockInsert(TRUE);
|
|
InitDbSymbolAnnotate(TRUE);
|
|
InitDbPolyCurveEnt(TRUE);
|
|
}
|
|
|
|
void UnloadApplication()
|
|
{
|
|
InitDbPolyCurveEnt(FALSE);
|
|
InitDbSymbolAnnotate(FALSE);
|
|
InitDbBlockInsert(FALSE);
|
|
IniAecDbSheet(FALSE);
|
|
InitDbText(FALSE);
|
|
InitCurveEntity(FALSE);
|
|
InitEntity(FALSE);
|
|
} |