How should you read the following documentation?

From IDispatch::GetTypeInfoCount

The return value obtained from the returned HRESULT is one of the following: [S_OK → Success], [E_NOTIMPL → Failed]

And the sample below returns E_INVALIDARGand NOERROR.

As far as I understand, E_INVALIDARGnot S_OKas well as NOERROR, so what are you doing? Are you checking for invalid pointers or not?

COM seems to be the basis for everything, and I cannot find one good source of information about the correct behavior of a simple one IDispatch. How do you deal with such inconsistencies in your production code?

+3
source share
2 answers

COM , , . FAILED SUCCEEDED, , . .

HRESULT hr = ...;
if (FAILED(hr)) {
   ...

COM- , . . , (in-process, out-of-process, DCOM), COM- .

+6

NOERROR , S_OK. , E_POINTER.

NOERROR/S_OK E_NOTIMPL , , , , , E_POINTER.

, SUCCEEDED/FAILED.

+1

Source: https://habr.com/ru/post/1790704/


All Articles