找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 556|回复: 2

[分享]:Using VC 7.1 (Visual Studio .NET 2003) to Build for AutoCAD 2000/2002/20

[复制链接]
发表于 2005-3-22 17:42:28 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
Using VC 7.1 (Visual Studio .NET 2003) to Build for AutoCAD 2000/2002/2004
Despite the minor numerical change from Visual C/C++ version 7 to 7.1, Microsoft made some major changes in the compiler and linker in order to become more C++ standard compliant. These changes make it virtually impossible to use 7.1 to build for ObjectARX 2004 and earlier ObjectARX versions. The new compiler chokes on the earlier versions of ATL and MFC libraries because they were not standard compliant, yet these are required when building for ObjectARX because of its reliance upon Autodesk libraries. What's more, the tricks outlined above are not enough to solve this problem.

The new features in the VC 7.1 IDE (not to mention the bug fixes) make it more desirable than VC 7. For that reason I wrote VC Build Hook, a small add-in* for VC 7.1 that solves the compiler version problem by automatically switching the environment path to the VC 7 build tool directories at build time. This causes the build process to use the VC 7 build tools instead of the incompatible ones that shipped with VC 7.1. Note that you must have Visual C/C++ 7 installed in order for the path switching to work. If you only have Visual C/C++ 7.1 available, you must purchase the downgrade to Visual C/C++ 7 and install it also, otherwise the required VC 7 build tools won't be available on your system. This feature can be enabled for an entire solution or for individual projects.

VC Build Hook provides another useful fringe benefit: it sets the build process to idle priority, thus making other processes more responsive while a build is in progress. This feature can be enabled or disabled by changing an extended property in a Visual Studio solution.

* WARNING: This is my first attempt at writing a Visual Studio add-in. I advise users of this add-in to save early and often. In any case, I cannot be responsible for lost work caused by bugs in VC Build Hook! Proceed at your own risk!

To install this utility, simply download VCBuildHookSetup.msi (172k) and install it by selecting 'Open'. Once VC Build Hook is installed, you can enable or disable it in the Visual Studio 'Add-in Manager'. By default VC Build Hook will start every time Visual Studio starts. Use 'Add/Remove Programs' in Control Panel to completely uninstall VC Build Hook and remove its files.

Download: VCBuildHookSetup.msi (175k)
Version 1.1.1.0 uploaded 2004-04-13

To use VC Build Hook, you must first follow the steps outlined elsewhere on this page to ensure that your project uses the correct headers and libraries. Open a solution in Visual Studio, then open the property grid window and select the solution in the solution explorer window. If VC Build Hook is started, you should see two new properties: 'LowPriorityBuild' and 'UseVC7Paths'.



Set the new VC Build Hook extended properties to 'Yes' to enable the corresponding feature for the selected solution. Set the property to 'No' to disable it, or 'Default' to use the default setting. These settings persist with the solution (they are saved in the 'Globals' area of the solution file.) The 'UseVC7Paths' property may also be set for individual projects within a solution. Any project setting other than 'Default' will override the solution setting.


--------------------------------------------------------------------------------

Enabling IntelliSense and Class Browsing for ObjectARX Headers
A common complaint among ObjectARX programmers is that Visual C/C++ doesn't display IntelliSense context menus for classes defined in the ObjectARX headers. The trick is to include all the ObjectARX headers files somewhere in your solution. I created a new folder called ARXHeaders with subdirectories for every version of the ObjectARX SDK:

ARXHeaders
   ARX2
   ARX202
   ARX2000
   ARX2000i
   ARX2002
   ARX2004
   ARX2005

In each subdirectory, create a new empty static library project named e.g. 'ARX2005' and add every header file (*.h) from that version of the ObjectARX SDK to the project. It's important to give each project a unique name so that the project names don't collide when more than one is added to a single solution. Since there are no source files, there is no output file for these projects, and building them is a no-op. Nevertheless, adding one of these projects to an existing solution causes VC to "see" the ObjectARX classes and code definitions for use in IntelliSense. Another benefit of including the ObjectARX headers in the solution is the ability to use the class browser in VC to browse the ObjectARX SDK. Browsing can reveal some interesting undocumented functions, and it also proves very useful for providing a readable overview of class hierarchies and object definitions.

In projects that target multiple versions of AutoCAD (and therefore use multiple versions of the ObjectARX SDK) you can add the ARXHeaders project for each target version of ObjectARX. While adding multiple SDK versions won't tell VC which version of the SDK is used in a given source file or project, it does make each version separately available in the VC class browser for easy browsing.
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 3532个

财富等级: 富可敌国

发表于 2005-3-22 20:13:53 | 显示全部楼层
看不懂哦!能翻译一下吗?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2005-3-23 16:01:31 | 显示全部楼层
http://www.863s.com/list.asp?unid=143
这里是中文的,看看吧。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-11-16 10:47 , Processed in 0.334706 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表