BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Daryl
Guest





PostPosted: Mon Jan 26, 2004 9:11 pm    Post subject: Can't get this to work, please help... Reply with quote



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);



Back to top
Bruce Salzman
Guest





PostPosted: Mon Jan 26, 2004 9:32 pm    Post subject: Re: Can't get this to work, please help... Reply with quote



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



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Jan 26, 2004 11:31 pm    Post subject: Re: Can't get this to work, please help... Reply with quote




"Daryl" <stockd (AT) tpg (DOT) com.au> wrote


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



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.