Page 1 of 1

Switch - MessageBox

Posted: Wed Oct 24, 2007 2:43 pm
by simonrf
Hello all,

I wonder if someone could help me convert this below for siLang please.

switch(MessageBox(0, "Are You Sure You Want To Stop?",
" Stop? ", MB_YESNO))

case IDYES:
//do something
break;

case IDNO:
//do something else
break;

I tried removing the "Are You Sure You Want To Stop" with siLang1->GetText("STID_01") but I get type mismatch error messages.

Can someone help please, I am using C++Builder 5.

Thank you.

Posted: Wed Oct 24, 2007 3:13 pm
by isiticov
Just use GetTextC() or GetTextOrDefaultC() instead of GetText() since MessageBox() uses char * (PChar) for strings.

Posted: Wed Oct 24, 2007 4:20 pm
by simonrf
Excellent. thank you very much