Message 1 of 6
QueryInterface() problem
Not applicable
05-10-2007
01:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
After migration to ObjectARX 2007 I have troubles retrieving IAcadApplication interface to add menu items. The code looks something like this:
CComPtr< IDispatch > pAcadDisp = NULL;
pAcadDisp = acedGetAcadWinApp()->GetIDispatch(TRUE);
CComPtr< IAcadApplication > pAcad;
hr = pAcadDisp->QueryInterface(IID_IAcadApplication, (void**)&pAcad); // fails here with HRESULT of E_NOINTERFACE
I have checked IID_IAcadApplicatio identifier and it seems that I get one that is specified in ObjectARX 2004.
2007 version:
MIDL_DEFINE_GUID(IID, IID_IAcadApplication,0x8F17437C,0x2EFB,0x4FC4,0x81,0x88,0xEE,0xFA,0x50,0xFE,0x71,0x47);
2004 version:
MIDL_DEFINE_GUID(IID, IID_IAcadApplication,0x93bc4e71,0xafe7,0x4aa7,0xbc,0x07,0xf8,0x0a,0xcd,0xb6,0x72,0xd5);
I'm not a COM expert and I can't figure out how is it possible that IID_IAcadApplication is from 2004 OARX version. All paths are set to 2007 OARX.
I have tryed manually change this identifier through the VS IDE and everything worked fine.
I have 2005, 2007, 2008 AutoCAD installed on my computer.
Any ideas?
After migration to ObjectARX 2007 I have troubles retrieving IAcadApplication interface to add menu items. The code looks something like this:
CComPtr< IDispatch > pAcadDisp = NULL;
pAcadDisp = acedGetAcadWinApp()->GetIDispatch(TRUE);
CComPtr< IAcadApplication > pAcad;
hr = pAcadDisp->QueryInterface(IID_IAcadApplication, (void**)&pAcad); // fails here with HRESULT of E_NOINTERFACE
I have checked IID_IAcadApplicatio identifier and it seems that I get one that is specified in ObjectARX 2004.
2007 version:
MIDL_DEFINE_GUID(IID, IID_IAcadApplication,0x8F17437C,0x2EFB,0x4FC4,0x81,0x88,0xEE,0xFA,0x50,0xFE,0x71,0x47);
2004 version:
MIDL_DEFINE_GUID(IID, IID_IAcadApplication,0x93bc4e71,0xafe7,0x4aa7,0xbc,0x07,0xf8,0x0a,0xcd,0xb6,0x72,0xd5);
I'm not a COM expert and I can't figure out how is it possible that IID_IAcadApplication is from 2004 OARX version. All paths are set to 2007 OARX.
I have tryed manually change this identifier through the VS IDE and everything worked fine.
I have 2005, 2007, 2008 AutoCAD installed on my computer.
Any ideas?