Monday, 4 March 2013

UpdateData(false)


·  Get the user name from the edit box using UpdateData(false) which reads from the edit
box to the variable. Add “Hello there,” with string concatenation, display a message box
and display back to the main screen with UpdateData(true).
void Dlg::OnButton1()
{
UpdateData(true);
m_text = "Hello there, " + m_text + "!";
UpdateData(false);
AfxMessageBox(m_text);
// TODO: Add your control notification handler code here
}
·  The next step is displaying the dialog box. To do this we have to include the support for
our Dlg class in the view class by including the Dlg.h header file in
ComputerConversationView.cpp.
// ComputerConversationView.cpp : implementation of the
// ComputerConversationView class
//
#include "stdafx.h"
#include "ComputerConversation.h"
#include "ComputerConversationDoc.h"
#include "ComputerConversationView.h"
#include "Dlg.h"

No comments:

Post a Comment