Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET AutoCAD
Hi everyone,
 
I am develpoing a small vb.net forms application. From that trying to load the Autocad using the following code.
 
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.
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 30-Jun-10 22:05pm
Edited 30-Jun-10 22:17pm
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
v2
Comments
Siva_Si at 1-Jul-10 10:50am
   
Reason for my vote of 3
for reference link
E.F. Nijboer at 2-Jul-10 6:47am
   
Didn't the reference link help? Would like to know for future improvement of my answers.
Ankur\m/ at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

have you tried with register this dll in GAC.... Smile | :)
  Permalink  

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

  Print Answers RSS
0 Mathew Soji 330
1 BillWoodruff 260
2 Sergey Alexandrovich Kryukov 240
3 OriginalGriff 216
4 Afzaal Ahmad Zeeshan 208
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,028
3 Manas Bhardwaj 4,539
4 Maciej Los 3,845


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.1 | Last Updated 3 Jul 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100