Obtaining OLE Automation Error Text
This sample shows you how to get the associated error message text when you
receive one of those pesky, cryptic OLE Automation errors. OLE Automation
errors can occur for any number of reasons when working with ActiveX
components, creating objects,... Knowing the reason the error was raised is a
definite plus in solving the problem.
Download Source Code
The core of this program is the FormatMessage API
to which I pass in the error number along with the FORMAT_MESSAGE_FROM_SYSTEM
flag. In return, FormatMessage gives the text
associated with the error code.
Enter an OLE Automation error number in either hex or decimal and click the