Jump to content

AcadApplication w/ 2010 Using AutoCAD 2009 Type Library


Recommended Posts

Posted

Hi everyone

 

Hoping someone might have some insight on this issue I'm having with my app going from AutoCAD 2009 to 2010...

 

My application uses the AutoCAD 2009 Type Library & ObjectDBX Common 17.0 Type Library... using the following protocols I am able to open and work with AutoCAD (as appropriate)

 

Private AutoCAD_Instance As AcadApplication

Try

 AutoCAD_Instance = GetObject(, "AutoCAD.Application")

Catch

 AutoCAD_Instance = CreateObject("AutoCAD.Application")

End Try

 

 

Once I installed 2010, I get the following error on the 'CreateObject' execution (the GetObject fails even if AutoCAD is open)

 

Exception Type : System.InvalidCastException

Unable to cast COM object of type 'Autodesk.AutoCAD.Interop.AcadApplicationClass' to interface type 'Autodesk.AutoCAD.Interop.AcadApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{8F17437C-2EFB-4FC4-8188-EEFA50FE7147}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

 

This exception is eliminated once I replace the references to the 2010 versions... I'd like to be able to avoid this, if possible...

 

Incidentally, I get a similar error when loaded with 2010 references and trying to run 2009...

 

Any thoughts?

 

Many thanks!

Posted

Just wanted to let people know that I've been able to get this to work by redefining 'XXXXX as Object' (vs AcadApplication)...

 

I guess this is late-binding? It works overall except with the .GetInterfaceObject I'm trying to use when restoring 'LayerStates'

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...