Function ComLastMessage() Foundation

Returns error message after calling GetObject() or CreateObject()

Syntax
ComLastMessage() --> cMsg
Return

A descriptive string of the error that occured in the functions GetObject() or CreateObject(). If the string returned is empty, no error occured.

Description

The function ComLastMessage() can be used to obtain the error message after GetObject() or CreateObject() is called.

The error condition of the Xbase++ COM/ActiveX layer is thread local.

Examples
Error message
// Try to create a COM/ActiveX component of an non-existing 
// component. Print out error information. 
#pragma Library( "ascom10.lib" ) 
PROCEDURE Main 
   oApp := GetObject( "noExistingfile.txt" ) 

   ? "Error: ", ComLastError() 
   ? "Description:" 
   ? ComLastMessage() 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.