karikari
karikari

Reputation: 6817

Print CString to Messagebox

How to correctly print a CString to messagebox? There is nothing appear..

CString testing;
testing = ExecuteExternalProgram();

MessageBox(NULL, testing, L"test", MB_OK);

Upvotes: 1

Views: 4059

Answers (1)

P47RICK
P47RICK

Reputation: 136

try AfxMessageBox.

http://msdn.microsoft.com/en-us/library/as6se7cb(v=vs.71).aspx

lpszText Points to a CString object or null-terminated string containing the message to be displayed in the message box.

or do:

MessageBox(NULL, testing.GetBuffer(), L"test", MB_OK);

Upvotes: 2

Related Questions