Mike Gleason Jr Couturier writes:
Hello all !
I'm creating an MFC program with the mySQL API.
Everything is working fine but when exceptions
occurs (ie when connecting, changing databases...),
I can't display the er.error message to the user...
How can I convert the error message to a
Hello all !
I'm creating an MFC program with the mySQL API.
Everything is working fine but when exceptions
occurs (ie when connecting, changing databases...),
I can't display the er.error message to the user...
How can I convert the error message to a char * or
a CString ?!?!
[...]
AfxMessageBox((CString)er.error);
It looks like you are trying to ask the compiler to cast er.error as a CString.
The compiler complains because the exception you are catching using
BadQuery (i.e., er.error) is probably implemented with STL. Usually you
would see the error dumped out as