A list of HRESULT codes
…because every time I search for a given HRESULT, all I get is yet another frigging VB website regurgitating the contents of WinError.h
ERROR_BAD_IMPERSONATION_LEVEL
(1364 or 0x80070542) – Usually means that you’ve forgotten to callCoInitializeSecurity
orCoSetProxyBlanket
with theRPC_C_IMP_LEVEL_IMPERSONATE
parameter. Oddly, I’ve seenCoImpersonateClient
succeed, but a later call toRegOpenKeyEx
fail with this error. I’d have been expectingERROR_ACCESS_DENIED
myself.E_NOINTERFACE
(0x80004002) – When attempting to marshal an interface pointer, COM couldn’t figure out how to create the proxy and stub. Check underHKEY_CLASSES_ROOT\Interface\{_iid_}\ProxyStubClsid32
. The value given here is a CLSID, so you should chase that down as well.- TYPE_E_CANTLOADLIBRARY (0x80029C4A) – When attempting to use typelib-based marshalling, COM couldn’t load the .TLB
file. Check in
HKEY_CLASSES_ROOT\Typelib\{_typelib-id_}\x.y\0\win32
to verify that the path to the .TLB file is correct. In particular, note that relative paths in this key are a bad idea.