Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi everyone,

I am develpoing a small vb.net forms application. From that trying to load the Autocad using the following code.

VB
Dim mycadAp As AcadApplicationmycadAp = CreateObjec(AutoCAD.Application)
mycadAp.Visible = TRUE

When creating the application for first time, it works fine. Loads the Autocad correctly. But for second time if run the application the following runtime error is occuring.

Cannot create ActiveX component at the CreateObject line.
I cant predict what is the problem. I've included the following references in my program.
VB
Imports Autodesk.AutoCAD.InteropImports Autodesk.AutoCAD.Interop.CommonPlease help me in this.


The all above said are working properly with Autocad2010, all problem with Autocad 2011 only.

Thanks in advance,
Shiva.
Posted
Updated 30-Jun-10 21:17pm
v3

have you tried with register this dll in GAC.... :)
 
Share this answer
 
Maybe this server component can only be started once? You could try to use GetObject instead of CreateObject after first call.

You could simply make a function for this checking if the CreateObject was already called and return the object using CreateObject or GetObject accordingly.

A link with some extra info:
http://msdn.microsoft.com/en-us/library/aa164798(office.10).aspx[^]

Good luck!
 
Share this answer
 
v2
Comments
Shiva S.S 1-Jul-10 10:50am    
Reason for my vote of 3
for reference link
E.F. Nijboer 2-Jul-10 6:47am    
Didn't the reference link help? Would like to know for future improvement of my answers.
Ankur\m/ 3-Jul-10 3:06am    
I guess you should put that comment below OP's question. Not sure if he gets notified for putting comment here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900