Click here to Skip to main content
13,048,788 members (70,740 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi everyone,

I am develpoing a small 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,
Posted 30-Jun-10 21:05pm
Updated 30-Jun-10 21:17pm
Rate this: bad
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:[^]

Good luck!
Siva_Si 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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 3 Jul 2010
Copyright © CodeProject, 1999-2017
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