老师给的程序看不懂求大神
// 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(_T("ACUISAMPLE"),_T("arxmfc"),_T("arxmfc"),ACRX_CMD_MODAL,dialogCreate,NULL,-1,theArxDLL.ModuleResourceInstance());
}
void unloadApp()
{
acedRegCmds->removeGroup(_T("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;
}