如题,我用的是vb.net写的,代码如下:
Public Sub StartCAD(ByVal DxfFilePath As String)
Dim Isgetcad As Boolean = True '判断是否找到打开的cad,默认找到
Try
acadApp = GetObject(, "AutoCAD.application")
Catch ex As Exception
Try
acadApp = CreateObject("autocad.application")
Isgetcad = False
Catch ex1 As Exception
MsgBox("无法打开AutoCAD")
Exit Sub
End Try
End Try
acadApp.Visible = True
AppActivate(acadApp.Caption)
If Isgetcad Then
acadApp.Documents.open(DxfFilePath)
Thisdrawing = acadApp.ActiveDocument
Else
acadApp.Documents.Close() '关闭cad初始文档drawing1
acadApp.Documents.open(DxfFilePath)
Thisdrawing = acadApp.ActiveDocument
End If
End Sub
在win7 64位系统下,当AutoCad选中“以管理员身份运行此程序”时,就无法打开cad,请问怎么解决?