关于控件注册
<P>Sub textadd()</P><P> <BR> Dim objDbx As AxDbDocument<BR> Dim objStyle(0) As Object<BR> If Left(Version, 2) = "15" Then<BR> Call AutoRegFile("C:\Program Files\AutoCAD 2002\axdb15.tlb")<BR> Set objDbx = CreateObject("ObjectDBX.AxDbDocument.1")<BR> ElseIf Left(Version, 2) = "16" Then<BR> Set objDbx = CreateObject("ObjectDBX.AxDbDocument.16")<BR> End If</P>
<P> '。。。。。。。。。。。。。。。。。。。。。。。。。。。 </P>
<P> End Sub</P>
<P>Function AutoRegFile(FileName As String)<BR>Dim reged As Boolean<BR>Dim RegFile1 As String<BR>Dim RegFile2 As String<BR>Dim BeReg As String<BR>Dim RetVal<BR>BeReg = Dir(FileName)<BR>If BeReg <> "" Then<BR> RegFile1 = Environ("windir") & "\system\regsvr32.exe "<BR> RegFile2 = Environ("windir") & "\system32\regsvr32.exe "<BR> If Dir(RegFile1) <> "" Or Dir(RegFile2) <> "" Then<BR> If Dir(RegFile1) <> "" Then<BR> RegFile1 = RegFile1 & "/s" & " " & BeReg<BR> RetVal = Shell(RegFile1, 1)<BR> Else<BR> RegFile2 = RegFile2 & "/s" & " " & BeReg<BR> RetVal = Shell(RegFile2, 1)<BR> End If<BR> Else<BR> MsgBox "找不到regsvr32.exe文件,你可能无法使用本软件!", vbCritical, "无法自动注册控件"<BR> End If<BR>Else<BR> MsgBox "找不到控件文件!", vbCritical, "无法自动注册控件"<BR>End If<BR>End Function</P>
<P>每次执行到黑体部分就报错,(cad2002版)</P>
<P>并且已经引用了ObjectDBX.1</P>
<P>为何?我在cad2004版下已经可以用了<BR></P> <STRONG>Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument")<BR></STRONG> <P>试过了没用,麻烦再帮我想想。谢了</P> <P>用这里的lisp函数注册一下试试:</P>
<P><A href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=8884" target="_blank" >http://bbs.mjtd.com/forum.php?mod=viewthread&tid=8884</A></P> <P>试过了,不行。</P>
<P>怎样才能判断是否注册成功呢,谢谢</P> <P>斑竹救我</P>
<P>想的脑袋都破了</P> <P>麻烦哪位传个基于ObjectDBX,且带ObjectDBX注册,可在2000上使用的程序上来。</P>
<P>我先看看</P>
页:
[1]