posts - 25,  comments - 36,  trackbacks - 0
 1     virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
 2         // TODO: Load dependencies here
 3 
 4         // You *must* call On_kInitAppMsg here
 5         AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
 6         
 7         // TODO: Add your initialization code here
 8         acutPrintf(L"hello world");
 9         return (retCode) ;
10     }我首先进入vs(我的vs2008)创建工程:

因为我安装了ObjectArx Wizard 所以就会在创建工程时候出现ObjextArx ,然后选择,输入你的工程名点击确定。
我们会看到一个要你选择界面。

Your Registered 那里我一般都没有填,貌似类似空间命名空间,你想填什么就填什么,估计为了排除不同arx的冲突吧。
我一般都会选择支持MFC,因为这样他同时也支持com,因为我们在开发时候界面一般也会用MFC ,所以最好选择支持MFC。

然后你点击Finish就可以了。

这样一个ObjectArx的工程就创建好了,现在就开始我们写代码了。
这个cpp 里面类就相当于我们c/c++ main 函数。
其实给我感觉就和mfc才不多,只是把main 封装在最里面,我们MFC开发时候也是看不到main,我们的代码就是在一个类里面写。所以这里也差不多的。
我们可以看出这段代码: 1     virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
 2         // TODO: Load dependencies here
 3 
 4         // You *must* call On_kInitAppMsg here
 5         AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
 6         
 7         // TODO: Add your initialization code here
 8 
 9         return (retCode) ;
10     }
11 
12     virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
13         // TODO: Add your code here
14 
15         // You *must* call On_kUnloadAppMsg here
16         AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
17 
18         // TODO: Unload dependencies here
19 
20         return (retCode) ;
21     }
这个2个函数显然是一个初始化(加载时候),一个卸载时候调用的。

现在我们开始添加代码。来打印hello world
在virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt)函数中添加一句 acutPrintf(L"hello world");
 1     virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
 2         // TODO: Load dependencies here
 3 
 4         // You *must* call On_kInitAppMsg here
 5         AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
 6         
 7         // TODO: Add your initialization code here
 8         acutPrintf(L"hello world");
 9         return (retCode) ;
10     }
然后我们我就可以导入cad进行测试了。 打开对应版本的cad ,如果你是ObjectArx 2012那么你就只能用cad 2012.我不知道为什么cad不向下兼容。。
在cad命令框里面输入APPLOAD,然后选择到我们生成的arx。
让后cad命令框就出现:命令: APPLOAD
hello world已成功加载 CadHelloWorld.arx。
看见到久违hello world.
这个是简单告诉新手怎么弄,最好是自己去看张帆 ----------ObjectARX开发实例教程他说东西。
posted on 2013-11-11 10:14 小鱼儿 阅读(3155) 评论(0)  编辑 收藏 引用
Cad Hello World(一f)" trackback:ping="http://www.cppblog.com/xvsdf100/services/trackbacks/204204.aspx" /> -->

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2013年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(4)

随笔档案(25)

搜索

  •  

最新评论

阅读排行榜

评论排行榜