John Hagen
April 8th, 1999, 03:56 PM
I am trying to display a lengthy piece of text in a dialog box. Here is my present code:
//***************************************************************************************
// Module: ShowStartUpMsg7()
//
// Description: Display Simulation StartUp Message 7 to the user.
//
// Inputs: None
//
// Returns: Nothing
//
//***************************************************************************************
void CStartUpMsgs::ShowStartUpMsg7()
{
char LINE_A[] = "This is test 7a of the national broadcasting system.";
char LINE_B[] = "For the next sixty seconds this station is conducting a test.";
char LINE_C[] = "This is only a test!";
char LINE_D[] = "This is test 7b of the national broadcasting system.";
char LINE_E[] = "For the next sixty seconds this station is conducting a test.";
char LINE_F[] = "I repeat, this is only a test!";
// Format the data string that will be used for the dialog box caption line.
wsprintf( user_msg, "%s %s %s %s %s %s", LINE_A, LINE_B, LINE_C, LINE_D, LINE_E, LINE_F);
lpstr_msg_to_user = (CString) user_msg;
AfxMessageBox(lpstr_msg_to_user);
}
There must be a simpler way to format the data and then display it within any dialog (AfxMessageBox() or a standard MODAL dialog. Can anyone show me how to do this easier?
Also, is there a way to have part of the text, within the dialog, a different color? If so, can you please provide an example?
Thanks!
John
//***************************************************************************************
// Module: ShowStartUpMsg7()
//
// Description: Display Simulation StartUp Message 7 to the user.
//
// Inputs: None
//
// Returns: Nothing
//
//***************************************************************************************
void CStartUpMsgs::ShowStartUpMsg7()
{
char LINE_A[] = "This is test 7a of the national broadcasting system.";
char LINE_B[] = "For the next sixty seconds this station is conducting a test.";
char LINE_C[] = "This is only a test!";
char LINE_D[] = "This is test 7b of the national broadcasting system.";
char LINE_E[] = "For the next sixty seconds this station is conducting a test.";
char LINE_F[] = "I repeat, this is only a test!";
// Format the data string that will be used for the dialog box caption line.
wsprintf( user_msg, "%s %s %s %s %s %s", LINE_A, LINE_B, LINE_C, LINE_D, LINE_E, LINE_F);
lpstr_msg_to_user = (CString) user_msg;
AfxMessageBox(lpstr_msg_to_user);
}
There must be a simpler way to format the data and then display it within any dialog (AfxMessageBox() or a standard MODAL dialog. Can anyone show me how to do this easier?
Also, is there a way to have part of the text, within the dialog, a different color? If so, can you please provide an example?
Thanks!
John