It won't.
It will put a little picture in the MB though.
Just a set of flags for the style. MB_OK is the default so not realy needed.
Printable View
It won't.
It will put a little picture in the MB though.
Just a set of flags for the style. MB_OK is the default so not realy needed.
Since you are using MFC, use CString for your buffer to erase the doubt and start first with the simple MessageBox function and then edit afterwards, like the code below.
//char buff[1024];
CString buff;
int answer;
answer = Cube(m_value);
//sprintf(buff, "The value of %i is: %i", m_value, answer);
buff.Format("The value of %d is: %d",m_value,answer);
MessageBox(buff);
Just try that...
Alextrons
Already got it working:
Thanks a lot for everyone's help.Code:void CWinCubeDlg::OnCube()
{
// TODO: Add your control notification handler code here
char buff[1024];
int answer;
UpdateData(TRUE);
answer = Cube(m_value);
sprintf(buff, "After being cubed, the value of %i is: %i", m_value, answer);
MessageBox(buff, "The results...", MB_ICONINFORMATION);
}
I have tried everything in this topic, and the compiler constantly gives me the error:
when I try:Quote:
error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'const char [28]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
from the example at the msdn or something similar.Code:MessageBox("Help, Something went wrong.", "Error",
MB_ICONERROR | MB_OK);
Shouldn't it be
L"Help, Something went wrong."
or
TEXT ("Help, Something went wrong.")
if you want to use UNICODE?
> 11-15-2001, 12:22 AM
You should also read the forum rules about digging up old threads.