Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3875114
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:13:46+00:00 2026-05-19T22:13:46+00:00

I am calling methods on WMI/WBEM interfaces that return HRESULTS. I want to display

  • 0

I am calling methods on WMI/WBEM interfaces that return HRESULTS. I want to display meaningful error messages for these error codes to the user. However, when I look up the HRESULT’s error message I only get strings like “IDispatch error #3598”.

Were can I find a list of these IDispatch error codes that explains their meaning?

Example code where errors may occur:

IWbemLocator *pLocator = NULL;
IWbemServices *pNamespace = NULL;
hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &pLocator);
if (FAILED(hr))
   return hr;

hr = pLocator->ConnectServer(wPath, NULL, NULL, NULL, 0, NULL, NULL, &pNamespace);
if(FAILED(hr))
   return hr;

Error lookup:

CString sMessage = _com_error(nError).ErrorMessage();

// sMessage now contains a string like "IDispatch error #3598"

Note: This does not help – it does not contain the HRESULTS I get. Neither are they contained in winerror.h.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:13:46+00:00Added an answer on May 19, 2026 at 10:13 pm

    COM servers can generate their own HRESULT error codes. The IErrorInfo interface helps a client to get a description of the error. You are not giving the _com_error class a chance to do that job, you don’t pass the IErrorInfo interface pointer to the constructor.

    First QI the interface for ISupportErrorInfo and call its InterfaceSupportsErrorInfo() method to verify that error reporting is supported. Next call GetErrorInfo() to obtain the IErrorInfo interface pointer. MSDN docs are here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

C# 3.0 Extension methods add extensions to the base Type making calling that method
When calling methods with a signature that has a delegate, using lamba syntax, Visual
How do you restrict users from calling methods that are only intended for unit
I'm having an issue with building a Javascript object, and calling methods within that
I'm having trouble with the MyClass::function(); style of calling methods and can't figure out
I'm having trouble getting PEX to automatically cover methods calling Linq extension methods, such
The extension methods: Response.AsJson Response.AsXml works fine when calling it from the constractor like:
I'm dealing with viewDidUnload and dealloc methods and I've founded a problem when calling
I recognized that calling a method on an Oracle Object Type takes longer when
What are the problems that calling this method can help with? Do you ever

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.