.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error creating instance of AcadApplication

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
4028 Views, 9 Replies

Error creating instance of AcadApplication

"We are having a problem on an end user's machine. Creating an instance of the AcadApplication object via COM has worked on hundreds of machines, however, this one user's machine is generating exceptions.

This code writting in VB.NET using VS 2005 (Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common have already been imported):

********************************************
dim acApp as new AcadApplication
********************************************

generates a "Creating an instance of the COM component with CLSID{28B7AA99-C0F9-4C47-995E-8A8D729603A1} from the IClassFactory failed due to the following error: 80010001".

If I try creating an instance using the old method:

********************************************
dim acApp as AcadApplication

acApp = CreateObject("AutoCAD.Application.17")
********************************************

a "cannot create ActiveX component" exception is generated.

Both methods work on all of our test machines, however, this one user is throwing exceptions. I had him check accout permissions to make sure he has adminitrative rights,which he does, Anti-virus is shut down, he reinstalled Acad 2007 with anti-virus off, and even tried running our EXE on another machine with a similar setup. There is something he has in common between his two machines where access to "AutoCAD.Application" is restricted, corrupted, or doesn't exist.

I'm completely wasted at this point trying to figure this out. Any help from you guys on what to look for would be greatly appreciated
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

It's a long shot, but check this registry setting:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLE\EnableDCOM

If it's set to "N", try setting it to "Y".

If this doesn't work, make sure you set it back again.
Message 3 of 10
Anonymous
in reply to: Anonymous

Thanks for the help. I really appreciate it. I'll have him check that and will post the results when they come back.
Message 4 of 10
cgay
in reply to: Anonymous

These steps are for Windows XP. Let us know if this is not the case.

1.) Make sure the Service Pack level of AutoCAD is the same on both machines.

2.) Try automating AutoCAD from VBA (like in MS Excel) on the Target machine:
a.) open a new Excel Workbook
b.) ALT+F11 to open VBA
c.) Right Click on VBA Project(Book ?) -> Insert -> Module
d.) Tools Menu -> References -> Select:
AutoCAD 2007 Type Library
AutoCAD/ObjectDBX Common 17.0 Type Library
e.) add this code to the new module you created in step c:
Sub Test()
Dim acadapp as AutoCAD.AcadApplication
Set acadapp = CreateObject("AutoCAD.Application")
acadapp.Visible = True
MsgBox acadapp.Version
Set acadapp = Nothing
End Sub
f.) click inside the code you just added and press F8 to step into the code to verify you can open AutoCAD
g.)press F5 and click OK on the message box to end the debugging session

Referencing the COM components in VBA often fixes incorrect or missing COM registration entries in the registry. After you complete the steps in this section, close AutoCAD and try your code to see if it works.

3.) Look at the 'Copy Local' of the Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common references in Visual Studio on the development machine. Try changing them , recompile and redeploy.

Last resort:
4.) Click Start->Run->Type dcomcnfg
Open Console Root->Component Services->Computers-> My Computer->DCOM Config
Find AutoCAD Application in list->Right Click->Properties
General Tab:
Authentication Level: Default
Location Tab:
Only 'Run Application on this Computer' Checked
Security Tab:
Launch and Activation Permissions: Use Default
Access Permissions: Use Default
Identity Tab:
The launching user option clicked.
Message 5 of 10
Anonymous
in reply to: Anonymous

Thank you. That's great information. I will try that as soonas I hear back from him on the:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLE\EnableDCOM
Message 6 of 10
ChandraM
in reply to: Anonymous

Hi,

Were you able to resolve this issue? Apparently, one of our end users is running into similar problem and we aren't quite sure how to go about resolving this.

Appreciate your response.
Thanks
Chandra M.
Message 7 of 10
funkyfresh
in reply to: Anonymous

yea we are having the same problem as well. We thought it was something to do with the fact that the end user isnt an admin on their computer but that only occasionally works. Any help would be appreciated
Message 8 of 10
StormyC
in reply to: funkyfresh

Same error here too .. any update?

 

Thanks.

Message 9 of 10
shamkumar
in reply to: StormyC

I'm trying to launch AutoCAD with the following code in visual studio on an win 7  machine:

 

code:-

 

string progID = "AutoCAD.Application.18.1";
System.Type acType = System.Type.GetTypeFromProgID(progID);
Autodesk.AutoCAD.Interop.AcadApplication autoCADApp = null;

try
{

autoCADApp = (Autodesk.AutoCAD.Interop.AcadApplication)System.Activator.CreateInstance(acType);

autoCADApp.Visible = true;

}

catch (Exception ex)
{
MessageBox.Show(ex.Message);

}


This code works some time and sometimes gives above error, I get the following error: Creating an instance of ther COM Component with CLSID {big long hex number} from the IClassFactory failed due to the following error: 80010001a ?

Message 10 of 10
Moustafa_K
in reply to: Anonymous

any luck on resolving this... I am also facing the same scenario on one of the computers??


-----------------------------------------------------
Moustafa Khalil

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost