Solved

Returning GetLastError() as HRESULT

Posted on 1999-01-11
2
1,655 Views
Last Modified: 2013-12-03
If I want to return a Win32 API error code (from GetLastError()) as a HRESULT, is this the correct way:

return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError());
0
Comment
Question by:piano_boxer
2 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 50 total points
Comment Utility
Use the HRESULT_FROM_WIN32() macro defined in <winerror.h> (it is automatically included as part of <windows.h>
0
 
LVL 4

Author Comment

by:piano_boxer
Comment Utility
Thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now