AutoCAD 2010 开发与之前版本的区别

本文迁移自本人网易博客,写于2012年3月20日

1. 使用了新的编译器,使编译文件更小了。

2. 部分函数签名和类的结构有所改变,比较显著的改变就是一些继承于 AcDbObject 和 AcDbEntity 的类的成员函数。好处就是类的结构清晰统一了。但也招来麻烦,所有的 Custom Object 和Coustom Entity 中用到worldDraw() 的编译时都会有这样的错误:

error C3248: 'AcGiDrawable::worldDraw': function declared as 'sealed' cannot be overridden by 'YourClass::worldDraw'

解决方案:用

protected virtual subFoo(…)

代替

public virtual foo(…)

重写基类的方法。如:subWorldDraw(…) 代替 worldDraw(…)

3. CUI and UI Update:Ribbon 和 AppMenu 有所改变。

4. Installer update:

AutoCAD 2007 = R17.0

AutoCAD 2008 = R17.1

AutoCAD 2009 = R17.2

AutoCAD 2010 = R18.0

5. fatal error C1189: #error : _WIN32_WINNT settings conflicts with _WIN32_IE setting

产生这个错误的原因是原因是_WIN32_WINNT的版本定义太老,老的VC代码对_WIN32_WINNT的典型设置是:

#ifndef _WIN32_WINNT

#define _WIN32_WINNT 0x0400

#endif

0x0400相对于VS2008所带的Plarform SDK(在文件sdkddkver.h中)中_WIN32_IE的定义来说太老了,导致不兼容,可以将其改成0x0501或更高的版本避免这个问题,如下所示:

#ifndef _WIN32_WINNT

#define _WIN32_WINNT 0x0501

#endif

也可以将这三行_WIN32_WINNT定义删除,这样就会使用Plarform SDK中的_WIN32_WINNT定义,自然就不存在不兼容问题了。不过出于对老版本VC的兼容考虑(毕竟以后可能还要使用VC6编译代码),最好这样修改:

#if _MSC_VER <= 1400 // MFC 8.0 or earlier

#ifndef _WIN32_WINNT

#define _WIN32_WINNT 0x0400

#endif

#endif

6. VS2008下,objectarx2010的图标问题(不显示)

这个问题在ArxWizardHelp.chm中的"Known Issues"中的后半部分"Wizards toolbar buttons not showing icons"有解决办法(建议直接看E文)

1)首先找到安装objectarx wizards(向导)的安装目录

一般情况下默认安装在 " c:\Program\Autodesk\ObjectARX Wizards for AutoCAD 20xx "路径下

2)在该目录下就有一个ArxWizardHelp.chm文件

【原文】

Wizards toolbar buttons not showing icons.(向导工具栏按钮不显示图标)

The Visual Studio toolbar button icons subsystem does not support Neutral Language Satelitte resources. When a resource language satelitte dll is missing the icons does not show up even if the AddIn is working. To solve the issue, you can either switch your OS locale to English (or one of the language coming with the Wizards [de/en/es/fr/it/ja/nl/ru/sv]), or build the resource for your locale.

加粗部分提出了解决办法:

1)切换系统locale(英语english或者objectarx wizards向导工具支持的语言[de/en/es/fr/it/ja/nl/ru/sv],具体的代码对应哪种语言locale,可以上网搜搜)

2)自己编译资源dll(推荐,自己编译比较保险,一般不会出什么岔子)

【编译方法】

To do this, execute the following command, assuming xx is your language code:

1)首先打开vs自带的命令提示符(在"开始菜单"中打开)

2)开始编译

假设objectarx wizards安装在目录" c:\Program Files\Autodesk\ObjectARX Wizards for AutoCAD 20xx"

a)使用cd命令进入到objectarx wizards安装目录下的子文件夹ArxAddInWiz中

cd "c:\Program Files\Autodesk\ObjectARX Wizards for AutoCAD 20xx\ArxAddInWiz"

b)创建目录zh-chs

mkdir zh-chs

c)将英文locale(en)中的文件中的所有.xml文件拷贝到zh-chs目录中

copy en\*.xml zh-chs

d)使用vs自带的命令工具Al.exe编译资源dll

Al.exe /embed:resx\Icons.resources /c:zh-chs /out:zh-chs\ArxAddInWiz.resources.dll

注意:是小写的L,不是大写的i,要是怕出错,可以全部大写AL.exe

AL.exe /embed:resx\Icons.resources /c:zh-chs /out:zh-chs\ArxAddInWiz.resources.dll

7. error LNK2019: 无法解析的外部符号 "void __cdecl RxTrace(wchar_t const *,...)" (?RxTrace@@YAXPB_WZZ),该符号在函数 "void __cdecl SKHYCheckEntOutOfBound(void)" (?SKHYCheckEntOutOfBound@@YAXXZ) 中被引用

1>../bin2010/HYCheckCmdReg_JL.arx : fatal error LNK1120: 1 个无法解析的外部命令

解决方法:将RxTrace方法写在Debug宏之前,并去掉inline限制。

8.AcAdDoubleClickEdit 在 arx2010 中 变到哪里了?

Solution

The AcDbDoubleClickEdit functionality that was exposed in AcDblClkEditPE.arx is now rolled up in AcApp.arx and acad.lib.

For AutoCAD 2010 to make double click extension protocol to work.…

1. Remove any loadModule() calls to AcDblClkEditPE.arx

2. Remove any calls to AcDbDoubleClickEdit::rxinit() as this is now done automatically for us.

3. Include the AcDblClkEdit.h

4. Add ACRX_DEFINE_MEMBERS(AcDbDoubleClickEdit); in one of your .cpp modules

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值