AutoCAD 2013/2014 DWG Format
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Problems creating instance. Error: 80040154
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello,
I have a problem creating an instance of the AcadApplicationClass.
The program is very simple:
Assembly autodeskWrapper = Assembly.LoadFile(@"C:\Windows\assembly\GAC_MSIL\Autodesk.AutoCAD.Interop\17.0.54.0__eed84259d7cbf30 b\Autodesk.AutoCAD.Interop.dll"); Type acadAppClassType = autodeskWrapper.GetType("Autodesk.AutoCAD.Interop. AcadApplicationClass"); object m_acadDApplicationClass; m_acadDApplicationClass = Activator.CreateInstance(acadAppClassType);
and the exception is:
Retrieving the COM class factory for component with CLSID {28B7AA99-C0F9-4C47-995E-8A8D729603A1} failed due to the following error: 80040154.
AutoCAD 2013 is installed but no license is provided (there is a 30 day trial period). I am trying to launch AutoCAD.
In C:\Windows\Assembly folder I can see the Autodesk interops:
Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common. Their version is 17.0.54.0.
In Component Services\Computers\My Computer\DCom Config I can see an enttry - AutoCAD Drawing. Its CLSID is: 6A221957-2D85-42A7-8E19-BE33950D1DEB.
I`ve read that the exception is because a 32bit process is trying to use 64bit DLL or vice versal. I have compiled my program in both 32bit and 64bit but with no results - I am getting the exception in both cases. Can anyone help me with this ...
Greetings
Solved! Go to Solution.
Re: Problems creating instance. Error: 80040154
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
>> Their version is 17.0.54.0
IMHO that's the point to start ==> AutoCAD 2013 has the internal release number 19.0 and not 17.0 which was AutoCAD 2007. So first update the references and then start debugging.
That your AutoCAD is running in 30-day mode does not make any differences for you (except the startup screen with activation).
BTW. for developing AutoCAD and dotNET there is a special forum >>>there<<<!
- alfred-
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Problems creating instance. Error: 80040154
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
Yeah you are completely right. After some investigation, I realized that AutoCAD 2013 is not installing the interops in the GAC at all - "If you’re using COM Interop, you’ll find the interop assemblies are no longer registered in the GAC (i.e. you won’t find them on the COM tab in the Add Project References dialog). You’ll now need to browse to Autodesk.AutoCAD.Interop.dll and Autodesk.AutoCAD.Interop.Common.dll (I believe) in the AutoCAD Program Files folder or on the ObjectARX SDK".
So my current code is in vain moreover it`s written in .NET 3.5 while the interops which are located under the installation folder of AutoCAD 2013 are built with .NET 4.0 thus I am not able to load them.
The conclusion is that I have to use the interops in the install dir and build my code with .NET 4.0

