Solved

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

Posted on 2000-03-24
3
577 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
login scripts windows 10 5 27
Windows 10 Locking 68 99
SCOM - Service Restart 1 30
have server generate smtp request for testing 2 24
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Determining the an SCCM package name from the Package ID
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

710 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