Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HRESULT CDemo::Div(/*[in]*/ LONG a, /*[in]*/LONG b, /*[out,retval]*/ LONG* pRet)
- {
- if (pRet == NULL)
- return E_POINTER;
- if (b == 0)
- {
- *pRet = 0; // is this redundant?
- return E_INVALIDARG;
- }
- *pRet = a/b;
- return S_OK;
- }
- ISmth *pSmth = NULL;
- pObj->GetSmth(&pSmth); // HRES is ignored
- if (pSmth) // Assumes that if GetSmth failed then pSmth is still NULL
- {
- pSmth->Foo();
- pSmth->Release();
- }
- HRESULT GetSmth( [out] ISmth** );
Add Comment
Please, Sign In to add comment