我用的是VB2008,连接AutoCAD2004 代码如下: Imports AutoCAD Public Class Form1 Public acadApp As AcadApplication 'AutoCAD 的application对象 Public acadDoc As AcadDocument 'AutoCAD document对象 Public moSpace As AcadModelSpace 'Modelspace 模型空间对象集合 Public paSpace As AcadPaperSpace 'PaperSace 图纸空间对象集合 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '加载AotuCAD On Error Resume Next acadApp = GetObject(, "AutoCAD.Application.16") If Err.Number <> 0 Then Err.Clear() acadApp = CreateObject("autocad.application.16") If Err.Number <> 0 Then MsgBox(Err.Description) End If End If acadDoc = acadApp.ActiveDocument moSpace = acadDoc.ModelSpace acadApp.Visible = True End Sub End Class 然后消息框中出现如下警告: 在 System.Exception 中第一次偶然出现的“Microsoft.VisualBasic.dll”类型的异常
请问这个警告是怎么回事,如何解决。 郁闷好几天了,盼解决。 |