brettawv
asked on
Visual Basic 6 "ActiveX can't create object" Autocad 2007
I have a VB 6 app. that creates an autocad drawing from dimensional data entered by the user. When the app gets to this line in the code "Set A2K = New AutoCAD.AcadApplication" I get the "ActiveX component cannot create object error." Error 429. The part that is odd is that if I run the application a second time the app runs fine with no errors. If I wait a little while and run the app again the error returns and then the second time it runs fine again. There must be something that is initialized the first time the Autocad dll tries to create a new acadapplication. Does anyone have an idea on how to make this work on the first try? Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not much exp. with .net but you could try
adding this:
<identity impersonate="true" userName="Domain\MyUsernam e" password="MyPassword"/>
(a valid admin account on the server)
in web.config after <authentication mode="Windows" />
adding this:
<identity impersonate="true" userName="Domain\MyUsernam
(a valid admin account on the server)
in web.config after <authentication mode="Windows" />
ASKER
Already have the impersonate setup. Back to using Autocad 2007. I used your idea from above in the .net app.
Try
A2K = New Autodesk.AutoCAD.Interop.A cadApplica tion
Catch
A2K = New Autodesk.AutoCAD.Interop.A cadApplica tion
End Try
Long pause first time through but hey it works. Thanks for your help.
Try
A2K = New Autodesk.AutoCAD.Interop.A
Catch
A2K = New Autodesk.AutoCAD.Interop.A
End Try
Long pause first time through but hey it works. Thanks for your help.
Thanks, wished it could have been a better solution than that. Ran across this link, seems they use GetObject first then try CreateObject. Might be worth a look.
http://www.kxcad.net/autodesk/autocad/Autodesk_AutoCAD_ActiveX_and_VBA_Developer_Guide/ws1a9193826455f5ff1a32d8d10ebc6b7ccc-6c91.htm
http://www.kxcad.net/autodesk/autocad/Autodesk_AutoCAD_ActiveX_and_VBA_Developer_Guide/ws1a9193826455f5ff1a32d8d10ebc6b7ccc-6c91.htm
ASKER