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

  • Home
  • SEARCH
  • 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 8885703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:22:29+00:00 2026-06-14T21:22:29+00:00

I want to retrieve error strings for DirectX 9, but I can find on

  • 0

I want to retrieve error strings for DirectX 9, but I can find on the web is using the FormatMessage() and _com_error.ErrorMessage(), both of which fail me.

hr = g_pd3dDevice->GetRenderTargetData(...
... // the debugger tells me hr = 0x8876086c
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
    FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
    NULL, hr, 0, (LPTSTR)&lpBuf, 0, NULL))
// it returns 0 with lpBuf unallocated

FormatMessage() fails and I use the it again with GetLastError() to see why FormatMessage() fails:
“The system cannot find message text for message number 0x%1 in the message file for %2.”

_com_error.ErrorMessage() tells me “Unknown error 0x8876086c”

  • 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-06-14T21:22:31+00:00Added an answer on June 14, 2026 at 9:22 pm

    To get DirectX error message, there are two functions — DXGetErrorString() and DXGetErrorDescription(). That being said, FormatMessage() will not get you what you want. Here is a small example:

    // You'll need this include file and library linked.
    #include <DxErr.h>
    #pragma comment(lib, "dxerr.lib")
    

    …

    if (FAILED(hr)) {
        fprintf(stderr, "Error: %s error description: %s\n",
            DXGetErrorString(hr), DXGetErrorDescription(hr));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to retrieve the data from this json url but is gives error.
I want to retrieve the name from database. But I always get error with:
when I want to retrieve date from access , I get an exception error
I want retrieve the width and height of browser in pixel(px) using ruby code.
I want to retrieve the last 3 registered users in cakephp using the field
I want to retrieve a Map from a using JAX-RS (text/xml) @GET public Map<String,String>
I am using Postgresql, when I want to use PDO to retrieve the latest
I want to retrieve an arrayList from the web service in my android activity.
I am kind of new to iOS development. I want to retrieve strings from
I want to access the sms logs also . but I don't find any

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.