Error Lookup Tool


If you want to find a particular error code returned by a function, you have several options. You can look in the WinError.h file for the error codes returned by Win32 API functions. Or, you can look up an error code by typing the code in the Watch window or the QuickWatch dialog box.

0x80004004, hr

This will display E_ABBORT.

Another way is to use the ERRLOOK.EXE utility provided by Microsoft within the Visual Studio to retrieve a system error message or module error message.

Still another option is to use the FormatMessage function to format a string with information about an error. The function requires a message definition as input. The message definition can come from a buffer passed into the function. It can come from a message table resource in an already loaded module. Or, the caller can ask the function to search the system's message table resource(s) for the message definition. In fact, using this small piece of code taken from MSDN will display the same error information as errlook.exe does.

DWORD dwError = 123;    // just an example

LPVOID lpMsgBuf;
if (!FormatMessage(
    (LPTSTR) &lpMsgBuf,
    NULL ))
   // Handle the error.

LocalFree( lpMsgBuf );

Additional Information and an Example on how to Load Information from a Specific Module

This small tool that I have created, ErrorOracle, is similar to ErrLook.exe from Microsoft; you can use it to get the error codes as described in MSDN for many modules (see the list below) without needing to know the module (a DLL file) in which the error messages are defined, which may not always be trivial to find.

Error Files

The error codes are described in files with the extension EFD. These files must be copied to the same directory where ErrorOracle.exe is placed. They are parsed when the application is launched. They are text files and the format is trivial, making it very easy to add new files for other modules, including application specific-error codes.


Module Name

The first line is the name of the module, which is displayed in the Section combo box. This must be followed by an empty line. After it come the error codes: The first line is the name or the error, such as LINEERR_INVALAGENTID or COMADMIN_E_APP_FILE_READFAIL, just to give some examples; the next line is the error code that can be given either in decimal or hexadecimal format. The following lines contain the error description and must be followed by an empty line. If you don't like the format, define your own format and override the ParseSection() method from CSectionManager.

How to Add ErrorOracle to Your Tools

First, you must build the application from the source files. You can do it with either VS6.0 or VS.NET.

Copy the executable (recommended a release build) to a location of your choice and put the database files from there.

I would recommend to add it to the VS tools. You can do that this way:

  • Open the tools manager
    • VS6.0: Go to Tools, Customize, and select the Tool tab
    • VS.NET: Go to Tools, External Tools...
  • Add a new tool
  • In the Title field, write Error Oracle
  • In the Command field, give the path to ErrorOracle.exe
  • You can specify for the Initial Directory the folder where the executable is located

After adding it, you can run it directly from the Tools menu.

How to Use ErrorOracle

To look up an error description, you can use either the error code or the error name. The error code can be given either in decimal or hexadecimal format. You can either type it directly or copy the name or value and use the Clipboard button to paste it from the Clipboard.

Use the Lookup button to search for the error. You can do a lookup either in all files, if All Sections is selected in the combo box, or search a particular section, by specifying it in the combo.

If the error is found, the Value edit box will be filed with the error code in hexadecimal format and the Description edit with the name of the error and the description.

Error codes are provided in for the following errors:

  • Active Directory Service Interface (ASDI.efd)
  • Collaboration Data Objects (CDO.efd)
  • COM+ (COM+.efd)
  • DirectX Media Objects (DMO.efd)
  • Image Color Management (ICM.efd)
  • Message Queuing (MessageQueuing.efd)
  • Network Meeting (NetMeeting.efd)
  • Network Management (NetManagement.efd)
  • OpenGL (OpenGL.efd)
  • Performance Monitoring (PerformanceMonitoring.efd)
  • Quality of Service (QOS.efd)
  • Telephony API (TAPI.efd)
  • URL Moniker (URLMoniker.efd)
  • Windows Simple Network Management Protocol (WinSNMP.efd)
  • Windows Sockets (WSA.efd)

About the Author

Marius Bancila

Marius Bancila is a Microsoft MVP for VC++. He works as a software developer for a Norwegian-based company. He is mainly focused on building desktop applications with MFC and VC#. He keeps a blog at, focused on Windows programming. He is the co-founder of, a community for Romanian C++/VC++ programmers.



  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Anthony Christie, the Chief Marketing Officer for Level Communications, is responsible for customer experience, worldwide marketing and product management. In this informative asset, he shares his insights into why a private network connection to cloud-bases applications is the right decision for your enterprise. Download now to find out more.

  • Enterprises are increasingly looking to platform as a service (PaaS) to lower their costs and speed their time to market for new applications. Developing, deploying, and managing applications in the cloud eliminates the time and expense of managing a physical infrastructure to support them. PaaS offerings must deliver additional long-term benefits, such as a lower total cost of ownership (TCO), rapid scalability, and ease of integration, all while providing robust security and availability. This report …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date