Board index » cppbuilder » Can't get this to work, please help...

Can't get this to work, please help...


2004-01-27 05:11:54 AM
cppbuilder99
Hi
I have been trying to get SysErrorMassage to successfully display the
Windows error message and I don't understand why! Could someone please
help...
Maybe I am missing a critical header file? I get no compiler warnings or
errors.
Thanks
Daryl
MessageDlg("Error msg : " + SysErrorMessage((int)GetLastError),
mtError, TMsgDlgButtons() << mbOK, 0);
//or
ShowMessage((int)GetLastError);
 
 

Re:Can't get this to work, please help...

Quote
MessageDlg("Error msg : " + SysErrorMessage((int)GetLastError),
mtError, TMsgDlgButtons() << mbOK, 0);
Try
MessageDlg(AnsiString("Error msg : ") + SysErrorMessage((int)GetLastError),
mtError, TMsgDlgButtons() << mbOK, 0);
Regards,
Bruce
 

Re:Can't get this to work, please help...

"Daryl" < XXXX@XXXXX.COM >wrote in message
Quote
I have been trying to get SysErrorMassage to successfully display
the Windows error message and I don't understand why!
You are missing a pair of parenthesis each time you call GetLastError(). It
is a function, afterall:
MessageDlg("Error msg : " + SysErrorMessage(GetLastError()), mtError,
TMsgDlgButtons() << mbOK, 0);
ShowMessage(GetLastError());
Gambit
 

{smallsort}