Directx Get Error String
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn
Directx 9 Error
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags directx error log Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you,
Directx Error Battlefield 4
helping each other. Join them; it only takes a minute: Sign up Is there a way to get the string representation of HRESULT value using win API? up vote 26 down vote favorite 8 Is there a function directx error s1023 in win API which can be used to extract the string representation of HRESULT value? The problem is that not all return values are documented in MSDN, for example ExecuteInDefaultAppDomain() function is not documented to return "0x80070002 - The system cannot find the file specified.", however, it does! Therefore, I was wondering whether there is a function to be used in common case. c++ windows winapi clr hresult share|improve this question asked Aug 10 '11 at 8:44 directx error origin khkarens 4411414 2 Title is different, but essentially the answer will be the same as for this one. –Christian.K Aug 10 '11 at 8:49 add a comment| 3 Answers 3 active oldest votes up vote 43 down vote accepted You can use _com_error: _com_error err(hr); LPCTSTR errMsg = err.ErrorMessage(); If you don't want to use _com_error for whatever reason, you can still take a look at its source, and see how it's done. share|improve this answer edited Jul 24 at 19:43 Cory Nelson 17.1k23061 answered Aug 10 '11 at 8:50 eran 14.8k3371 thank you eran! –khkarens Aug 10 '11 at 8:58 2 A more complete sample for convenience: inline CString GetMessageForHresult(HRESULT hr) { _com_error error(hr); CString cs; cs.Format(_T("Error 0x%08x: %s"), hr, error.ErrorMessage()); return cs; } –nietras Feb 9 '12 at 15:55 add a comment| up vote 11 down vote The Windows API for this is FormatMessage. Here is a link that explains how to do it: How to obtain error message descriptions using the FormatMessage API. For Win32 messages (messages with an HRESULT that begins with 0x8007, which is FACILITY_WIN32), you need to remove the hi order word. For example in the 0x80070002, you need to call FormatMessage with 0x0002. However, it does not always work for any type of message. And for some specific messages (specific to a technology, a vendor, e
Studio 2015 products Visual Studio Team Services Visual Studio Code Visual Studio Dev
Directx Error Dragon Age Inquisition
Essentials Office Office Word/Excel/PowerPoint Microsoft Graph Outlook OneDrive/Sharepoint Skype directx error bf4 Services Store Cortana Bing Application Insights Languages & platforms Xamarin ASP.NET C++ TypeScript
Directx Error Hardline
.NET - VB, C#, F# Server Windows Server SQL Server BizTalk Server SharePoint Dynamics Programs & communities Students Startups Forums MSDN Subscriber downloads http://stackoverflow.com/questions/7008047/is-there-a-way-to-get-the-string-representation-of-hresult-value-using-win-api Sign in Search Microsoft Search Windows Dev Center Windows Dev Center Explore What’s new for Windows 10 Intro to Universal Windows Platform Coding challenges Develop for accessibility Build for enterprise Windows Store opportunities Docs Windows apps Get started Design and UI Develop API reference Publish Monetize https://msdn.microsoft.com/en-us/library/windows/desktop/ms679360(v=vs.85).aspx Promote Games Get started UI design Develop Publish Desktop Get started Design Develop API reference Test and deploy Compatibility Windows IoT Microsoft Edge Windows Holographic Downloads Samples Support Why Windows Dashboard Explore What’s new for Windows 10 Intro to Universal Windows Platform Coding challenges Develop for accessibility Build for enterprise Windows Store opportunities Docs Windows apps Get started Design and UI Develop API reference Publish Monetize Promote Games Get started UI design Develop Publish Desktop Get started Design Develop API reference Test and deploy Compatibility Windows IoT Microsoft Edge Windows Holographic Downloads Samples Support Why Windows Dashboard Error Handling Error Handling Reference Error Handling Functions Error Handling Functions GetLastError GetLastError GetLastError Beep CaptureStackBackTrace FatalAppExit FlashWindow FlashWindowEx FormatMessage GetErrorMode GetLastError GetThreadErrorMode MessageBeep RtlLookupFunctionEntry RtlNtStatusToDosError RtlNtStatusToDosErrorNoTeb RtlPcToFileHeader RtlUnwind RtlUnwind2 RtlUnwindEx RtlVirtualUnwind SetErrorMode SetLastError SetLastErrorEx SetThreadErrorMode TOC Collaps
topic ForumsMembersHelp Files Developer Journals Gallery Calendar Downloads Resources Store Classifieds Tracker Links Home For Beginners Articles All Articles Post an Article Technical Game Programming General Programming Graphics Programming http://www.gamedev.net/topic/37193-converting-hresult-to-string/ and Theory DirectX and XNA OpenGL and Vulkan Multiplayer and Network Programming Artificial Intelligence Math and Physics Mobile Development Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design Music and Sound Visual Arts Business Breaking into the Industry Production and Management Interviews Business and Law Event Coverage Forums All Forums Technical Game Programming General Programming Graphics Programming and Theory DirectX and XNA OpenGL & Vulkan Multiplayer directx error and Network Programming Artificial Intelligence Math and Physics Mobile & Console Development Build Systems & Source Control Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design Writing For Games Music and Sound Visual Arts Gallery Business Breaking into the Industry Business & Law Production & Management Community GDNet Lounge Coding Horrors Article Writing Comments, Suggestions and Ideas Your Announcements Hobby Project Classifieds Indie Project Showcase Community Developer directx get error Journals GDNet+ Subscriptions Gallery Store Classifieds Jobs Freelancers Hobby Projects Marketplace Newsletter » Home » Forums » The Technical Side » DirectX and XNA Chat Watched Content New Content Converting HRESULT to string Started by FrigidHelix, Jan 14 2001 11:05 AM Old topic! Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic. You cannot reply to this topic 2 replies to this topic #1 FrigidHelix Members -Reputation: 122 Like Likes Like Posted 14 January 2001 - 11:05 AM While debugging, I am able to view the value of the HRESULT returned by directX functions. However, I am unable to make sense out of this, as the documentation (from what I found), only gives the define of the error code, and not its actual value. Is there anyplace where the values are listed, so I can see what the error is, or is there a function to convert it to a string. I remember having seen a function which did this, i just dont remember where it was. Back to top #2 dooz Members -Reputation: 271 Like