已有的AutoCAD二次开发产品为了支持最新版本的AutoCAD,这两天把Arx工程升级到了VC10,也安装了AutoCAD2013和AutoCAD2014。但当加载非AutoCAD自带的程序时,弹出了如下的提示:
网上搜了一下,在KW的博客(http://through-the-interface.typepad.com/through_the_interface/2013/03/autocad-2014-for-developers.html)里找到了问题说明和解决方法,E文如下:
- Use the Autoloader to load the module
- The Autoloader folders are trusted automatically
- Make sure the module has been digitally signed
- Authenticode-signed executables are trusted automatically
- This is not the same as “signing the assembly” in Visual Studio, which refers to the act of assigning a strong name to a .NET assembly
- Authenticode-signed executables are trusted automatically
- Add the module’s folder to the TRUSTEDPATHS (or TRUSTEDDOMAINS – see below) system variable
- Set SECURELOAD to 0
- Please do not do this: it really does defeat the object and leaves your system open to malware attack
第一种方法,使用 Autoloader 解决,大概搜了下,不是很清楚。于是没有采用该种方法。哪位大侠知道的,还麻烦告知一二。
第二种方法,确保你的程序拥有数字签名,搞这个东东是需要pay money滴,所以也pass掉。
第三种方法,使用 TRUSTEDPATHS 系统变量。即将你的程序所在的路径添加到该系统变量中,以后加载你的程序就不会再提示了。
第四种方法,使用 SECURELOAD 系统变量,KW强烈不推荐,说不安全,于是也pass掉。
综上,俺采用第三种方法。
在CAD的命令行中可以通过输入
命令: TRUSTEDPATHS
输入 TRUSTEDPATHS 的新值,或输入 . 表示无 <“D:\***\Arx\***\…”>
来将你程序的路径写入 TRUSTEDPATHS 系统变量。多个路径中间用“;”分割。以“\…”结尾表示该路径下的所有子路径也在信任路径列表中。
在Arx程序中可以用 acedSetVar() 来修改TRUSTEDPATHS 系统变量,非Arx可以直接操作注册表,TRUSTEDPATHS 系统变量的位置在
英文版:”HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R19.1\ACAD-D001:409\Profiles\<配置名称>\Variables”
中文版:”HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R19.1\ACAD-D001:804\Profiles\<配置名称>\Variables”


杭州格原