Definition of SUCCEEDED (): #define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
Background: when the Ok button is pressed in the dialog box, I need to return the value HRESULT hrso that SUCCEEDED(hr)it is true. If I click Cancel, I need to return a negative value. I could use bools, but this will break the existing template (usually the hr values ββcome from the depths of the system dlls). So, I know that I can return S_OKto OK, but what can I return to Cancel? I could have just return (HRESULT)-1;, but there should be a better way - some HRESULT constant, which has a negative value and represents a general failure. S_FALSEnot so, for him the value is defined as 1L.
Please help me find the right constant.
source
share