jsurpless Posted April 10, 2009 Posted April 10, 2009 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! Quote
jsurpless Posted April 13, 2009 Author Posted April 13, 2009 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' Quote
Recommended Posts
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.