10-18-2010 02:02 PM
Hi all,
I am writing a program that interacts with Excel. For debugging purposes I want to display messages that correspond to the error codes. Has someone already written a function that does this? I ask, because I imagine there are too many error codes to quickly write this up.
Thanks in advance,
Turbo
Solved! Go to Solution.
10-19-2010 12:16 AM
Does a function like this answer your question?
//----------------------------------------------------------------------------
// ReportAppAutomationError
//----------------------------------------------------------------------------
void ReportAppAutomationError (HRESULT hr, int line)
{
char errorBuf[512];
if (hr < 0) {
CA_GetAutomationErrorString (hr, errorBuf, sizeof (errorBuf));
sprintf (errorBuf, "%s (line %d)", errorBuf, line);
MessagePopup ("Severe error", errorBuf);
}
return;
}
10-20-2010 08:28 AM
Yes, thank you.