// ArxMFC.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include <afxdllx.h>
#include "ArxMFC.h"
#include "ArxMFCdlg.h"
#include "AcExtensionModule.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern "C" HWND adsw_acadMainWnd();
AC_IMPLEMENT_EXTENSION_MODULE(theArxDLL);
void dialogCreate()
{
ArxMFCdlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));
int nReturnValue=dlg.DoModal();
}
static void initApp()
{
CAcModuleResourceOverride resOverride;
acedRegCmds->addCommand("ACUISAMPLE","arxmfc","arxmfc",ACRX_CMD_MODAL,dialogCreate,NULL,-1,theArxDLL.ModuleResourceInstance());
}
void unloadApp()
{
acedRegCmds->removeGroup("ACUISAMPLE");
}
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
theArxDLL.AttachInstance(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
theArxDLL.DetachInstance();
}
return 1;
}
extern "C"
AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg,void* pkt)
{
switch(msg)
{
case AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(pkt);
acrxDynamicLinker->registerAppMDIAware(pkt);
initApp();
break;
case AcRx::kUnloadAppMsg:
unloadApp();
break;
case AcRx::kInitDialogMsg:
break;
}
return AcRx::kRetOK;
}
慕码人2483693
相关分类