behalf.
Agains thanks for your help.
John <John@discussions.microsoft.com> wrote:
STDMETHODIMP CSomeObj::Extract(RECT roi, ISomeObj** pSomeObjOut)
{
CComObject<CSomeObj>* pSomeObj = 0;
CComObject<CSomeObj>::CreateInstance(&pSomeObj);
pSomeObj ->AddRef();
...
...
...
hr = pSomeObj->QueryInterface(&pSomeObjOut);
Should be
hr = pSomeObj->QueryInterface(pSomeObjOut);
(no ampersand).
pSomeObj ->Release();
return hr;
}
And here is the code that calls the method, and when it returns
pNewSomeObj is NULL. I don't know if it's because I'm using a smart
pointer and it goes out
of scope.
RECT roi;
CComPtr<ISomeObj> pNewSomeObj;
HRESULT hr = pSomeObj->ExtractROI(roi, &pNewSomeObj);
You seem to be calling a different method, not the one you've
implemented. What's the connection between ExtractROI and Extract?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925