OOFILE | Downloads | Purchasing | Press | Services | Company Information | Soapbox | References | F.A.Q. | HOME

OOFTST 8 - raising error messages   

This sample just tests the dbConnect::raise() method of error reporting which should use a message box on the Windows and Mac environments and console output elsewhere 


The include files are:

#include "oofile.h"	// the general oofile library
int main()
{
	cout << "Testing" << endl << flush;

Here we try and raise our error message. We pass an 'ostrstream' to it -> this is an output stream to which we can pass values and strings just like cout.

Testing: function dbConnect::raise()

	dbConnect::raise( ostrstream() 

We test for embedded newlines and use a long string to test for overflow problems and for word-wrapping.

Testing: error message - embedded newlines
Testing: error message - word wrapping
Testing: error message - string overflow error

	   << "This is a longer string to see if I can get the Alert to handle it or not"
	   << endl
	   << "and just what happens with embedded newlines, also to see if the wrapping works OK "
	   << "for very long lines which I am sure are now exceeding the 255 character limit, or "
	   << "if not yet will soon be and so it will be interesting to see just what the compiler "
	   << "complains of if indeed it does complain!");
	cout << "Finished" << endl << flush;
	  
	return EXIT_SUCCESS;
}       
 

 

Feature index

(c) Copyright A.D. Software 1994-2000 (All Rights Reserved).
Last Updated: 9th September 2001