⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exam07.cpp

📁 ARX/CAD二次开发
💻 CPP
字号:
// exam07.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "exam07.h"

#include "MyExam07Dlg.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()
{
    // Modal
    MyExam07Dlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));
    int nReturnValue = dlg.DoModal();
}

static void initApp()
{
	CAcModuleResourceOverride resOverride;
	acedRegCmds->addCommand(
		"EXAM07",
		"ACUISAMPLE",
		"ACUISAMPLE",
		ACRX_CMD_MODAL,
		dialogCreate,
		NULL,
		-1,
		theArxDLL.ModuleResourceInstance());
}

static void unloadApp()
{
	acedRegCmds->removeGroup("EXAM07");
}

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;   // ok
}

extern "C" AcRx::AppRetCode acrxEntryPoint(
AcRx::AppMsgCode msg, void* appId)
{
	switch( msg )
	{
	case AcRx::kInitAppMsg:
		acrxDynamicLinker->unlockApplication(appId);
		acrxDynamicLinker->registerAppMDIAware(appId);
		initApp();
		break;
	case AcRx::kUnloadAppMsg:
		unloadApp();
		break;
	case AcRx::kInitDialogMsg:
		break;
	default:
		break;
	}
	return AcRx::kRetOK;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -