|
发表于 2004-9-2 15:02:00
|
显示全部楼层
我是按 ObjectARX 2004\arxlabs 下的ObjectARXLabs.chm中的 step1 一步步做的只是将显示”HelloWord"部分改了。原码是
#include "stdafx.h"
#include
#include
//#include
//#include
void initApp();
void unloadApp();
void helloWorld();
void initApp()
{
// register a command with the AutoCAD command mechanism
acedRegCmds->addCommand("HELLOWORLD_COMMANDS",
"Hello",
"Bonjour",
ACRX_CMD_TRANSPARENT,
helloWorld);
}
void unloadApp()
{
acedRegCmds->removeGroup("HELLOWORLD_COMMANDS");
}
void helloWorld()
{
CString a = "Hello World!";
acutPrintf(a);
}
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg)
{
case AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(pkt);
acrxRegisterAppMDIAware(pkt);
initApp();
break;
case AcRx::kUnloadAppMsg:
unloadApp();
break;
default:
break;
}
return AcRx::kRetOK;
}
|
|