jxh2003zfr 发表于 2006-8-5 12:22:00

[求助]AutoCAD2006使用VBA問題

本帖最后由 作者 于 2006-8-8 8:24:08 编辑 <br /><br /> <P>我在使用AutoCAD 2006时总是出现如图所示的错误,请问是什么原因呀?此错误是随机出现的,不过频率比较高,一天10几次!处理不同图也是一样,是不是内存错误(AutoCAD的Bug)?</P>
<P>当我将以上代码注释以后,一天只会出现一两次这样的错误!</P>
<P>private winapi as APIACTIONS.APIAC&nbsp;&nbsp;&nbsp; '此为用VB编写的AxtiveX Dll,在VB中调试并使用无任何问题</P>
<P>Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)<BR>Dim strCmd As String, strReg As String</P>
<P>Set winapi = New APIACTIONS.</P>
<P>If FirstLine Like "(*:*)" And Len(FirstLine) &lt; 20 Then<BR>&nbsp;&nbsp;&nbsp; strCmd = Mid(FirstLine, InStr(FirstLine, ":") + 1, InStr(FirstLine, ")") - InStr(FirstLine, ":") - 1)<BR>&nbsp;&nbsp;&nbsp; strReg = winapi.RegGetSetting("software\autodesk\", "VLispUsed", strCmd)<BR>&nbsp;&nbsp;&nbsp; If strReg = "" Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; winapi.RegSetSetting "software\autodesk\", "VLispUsed", strCmd, 1<BR>&nbsp;&nbsp;&nbsp; Else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; winapi.RegSetSetting "software\autodesk\", "VLispUsed", strCmd, Val(strReg) + 1<BR>&nbsp;&nbsp;&nbsp; End If<BR>End If<BR>Set winapi = Nothing<BR>End Sub</P>
<P> </P>

雪山飞狐_lzh 发表于 2006-8-6 15:53:00

<P>到应用版去问问吧</P>

jxh2003zfr 发表于 2006-8-8 08:26:00

肯请各位帮帮手,烦恼啊!搞不定!
页: [1]
查看完整版本: [求助]AutoCAD2006使用VBA問題