BricsCAD二次开发之外部组件发生异常bug

2 篇文章 1 订阅

前言

BricsCAD二次开发时,使用c#语言开发,在安装目录下的API目录下有个README.txt。

Create a class library using the class library wizard under your preferred .NET language.  There are currently two DLLs that need to be referenced, BrxMgd.DLL and TD_Mgd.DLL. These DLLs are located in your BricsCAD installation folder. An important note:  when referencing these two DLLs, its important to set the 'Copy Local' property  to false. All other DLLs such as referenced COM DLLs or satellite DLLs can have their the 'Copy Local' property to true, or as needed by your project.

意思是BrxMgd.DLL and TD_Mgd.DLL这两库必需引入,同时Copy Local必需设为false,下面遇到的问题就是Copy Local设为true引起的,或者说由于以前设为true过,导致Debug目录下这两文件,必需手动删除

问题

在操作BricCAD块信息时,用到一些API,在取Bricscad.ApplicationServices.DocumentManager.MdiActiveDocument对象时有时会报错,
或者报System.ArgumentException异常
或者

  外部组件发生异常
   在 _CxxThrowException(Void* , _s__ThrowInfo* )
   在 OdDbTransactionManager.createObject(OdSmartPtr<OdDbTransactionManager>* )
   在 Teigha.DatabaseServices.Database.get_TransactionManager()

或者如下图错误
在这里插入图片描述

图上有显示问题出在TD_Mgd.dll

解决办法

  1. 选中TD_Mgd.dll库,在属性面板里将复制本地Copy Local设为false
  2. 将输出目录DebugTD_Mgd.dll删除(如果有的话)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值