Click here to Skip to main content
15,886,705 members
Articles / Desktop Programming / MFC

Creating embedded dialogs in MFC

Rate me:
Please Sign up or sign in to vote.
4.70/5 (36 votes)
29 Jul 20036 min read 251.9K   6.4K   83  
Creating embedded dialogs in MFC using DS_CONTROL
// Dialog2.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "Dialog2.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDialog2 dialog


CDialog2::CDialog2(CWnd* pParent /*=NULL*/)
	: CDialog(CDialog2::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialog2)
	m_strEdit1 = _T("");
	//}}AFX_DATA_INIT
}


void CDialog2::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialog2)
	DDX_Text(pDX, IDC_EDIT1, m_strEdit1);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDialog2, CDialog)
	//{{AFX_MSG_MAP(CDialog2)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialog2 message handlers

void CDialog2::OnButton1() 
{
   AfxMessageBox(_T("Dialog2:Button1 pressed"));
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United Kingdom United Kingdom
I make computers talk to other computers - well thats that I tell everyone I do. What I really do is connectivity and syncronization software for Windows Ce, PalmOS, Symbian on client devices and MFC/ATL/.NET on the Windows Servers.

I am also an expert with Microsoft Exchange and Databases and pretty good with Lotus Notes as well.

Comments and Discussions