"Fred" <not@here.com> ha scritto nel messaggio
news:KPWdnTuv1IjX3q_anZ2dneKdnZydnZ2d@pipex.net...
Note I see that it is not a Failure, it returns the value of the
reference
count, but I dont query IID_IBasicBitmapOps
anywhere else.
if (SUCCEEDED(pBitmapImage->QueryInterface(IID_IBasicBitmapOps,
(void**)&pBasicBitmapOps)))
{
hr=pBasicBitmapOps->Release();
}
What do you mean?
You call QueryInterface for IID_IBasicBitmaoOps; so, on success,
pBasicBitmapOps points to an IBasicBitmapOps interface.
(Note that QueryInterface implementation calls AddRef.)
Then you release the returned interface, calling Release.
The error is to set the return value to "hr", beacuse Release does *not*
return HRESULT.
Other than that and not using smart pointers (which I suggest you to
use...), your code seems correct.
Giovanni
Yes, Thanks. See my other follow up where I wonder why the releasing the
interface doesn't return 0.