Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Translating numbers into human readable mneonic strings ie. errlookup.exe

Posted on 2000-03-24
3
Medium Priority
?
594 Views
Last Modified: 2013-12-28
errlookup.exe when given an error code returns a description.  Is there
any interface/DLL in NT which when given an error code returns a
short corresponding NT name for the error, and a longer description.
It seems unbelievable that errlookup.exe would exist, but a program
could not utilize its functionality.

Partial answer.. for OLE/DB use the extended error capabilities.. log the
error, and then immediately read back the answer.. but this doesn't
presumably cover all error codes, and gives no short name eg. E_FAIL
0
Comment
Question by:ijdavis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
pjknibbs earned 400 total points
ID: 2656618
You can use the API function FormatMessage() to translate Win32 error codes to strings as follows:

LPVOID lpMsgBuf;
FormatMessage(
    FORMAT_MESSAGE_ALLOCATE_BUFFER |
    FORMAT_MESSAGE_FROM_SYSTEM |
    FORMAT_MESSAGE_IGNORE_INSERTS,
    NULL,
    GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
    (LPTSTR) &lpMsgBuf,
    0,
    NULL
);
// Process any inserts in lpMsgBuf.
// ...
// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
// Free the buffer.
LocalFree( lpMsgBuf );

Hope that helps!
0
 

Author Comment

by:ijdavis
ID: 2656954
Thanks for the response..

The problem is that: FormatMessage(E_FAIL)

Returns "Unspecified Error" but not
"E_FAIL"...

FormatMessage(DB_SEC_E_AUTH_FAILED)
which is an OLE/DB error code
returns nothing..

But you pointed me in the right direction and I worked out what the error module is for OLE/DB.  It is not well documented but it is:

\program files\common files\system\
ole db\msdaerr.dll
0
 

Author Comment

by:ijdavis
ID: 2657615
If anyone wishes to discuss this
issue further please email me at:
ijdavis@solo.uwaterloo.ca
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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