How can I compare the value returned from a method with HRESULT
? I tried this but it is not working:
FPropStg.DeleteMultiple(1, psProp) == VSConstants.S_OK
The type defintion for DeleteMultiple() is:
HRESULT IPropertyStorage.DeleteMultiple(Ulong, Propspec)
I have written VSConstants.S_OK
. Is there a way I can write S_OK
directly? I made an attempt to do so but got an error that indicated that S_OK
does not exist in the current context.
I also checked HRESULT
against the Windows common system-wide codes. But the value I am receiving for HRESULT
is not in that list. Note that I have included the namespaces System.Exception
and System.Security.Cryptography.StrongNameSignatureInformation
.
All that said, I basically have two questions:
- Is there a way to write
S_OK
instead ofVSConstants.S_OK
? - How can I compare the return value of a method with
S_OK
?
HRESULT hr = FPropStg.DeleteMultiple(1, psProp);
if (hr == S_OK) // S_OK does not exist in the current context...
{
}