Getting COM Error: Scalar deleting destructor.
-
Hi, I am working on Excel Automation. Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object. Following is the code: IDispatch* p=NULL; HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p); if(hr == S_OK) { try { Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow); Excel::_ApplicationPtr xl; xl = pWindow->Application; But getting com exception at above line. The com error: _Vfpointer: scalar deleting destructor(unsigned int) m_hresult:"Member not found". I googled but there is no clarity in solution. If any clue, please let me know. Thanks in Advance. Regards, KTTransfer.
-
Hi, I am working on Excel Automation. Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object. Following is the code: IDispatch* p=NULL; HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p); if(hr == S_OK) { try { Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow); Excel::_ApplicationPtr xl; xl = pWindow->Application; But getting com exception at above line. The com error: _Vfpointer: scalar deleting destructor(unsigned int) m_hresult:"Member not found". I googled but there is no clarity in solution. If any clue, please let me know. Thanks in Advance. Regards, KTTransfer.
KTTransfer wrote:
Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow);
What's the deal with this? You'd hope
Excel::WindowsPtr
wraps anIDispatch
pointer (does it?). Try this:Excel::WindowsPtr pWindow = NULL;
HRESULT hr = p->QueryInterface(&pWindow);Steve
-
KTTransfer wrote:
Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow);
What's the deal with this? You'd hope
Excel::WindowsPtr
wraps anIDispatch
pointer (does it?). Try this:Excel::WindowsPtr pWindow = NULL;
HRESULT hr = p->QueryInterface(&pWindow);Steve
I tried this,in this case I am getting "hresult hr" as "E_NOINTERFACE".
-
I tried this,in this case I am getting "hresult hr" as "E_NOINTERFACE".
I'd take it at its word.
Steve