Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Win32 Simple Application AppWizard

, 22 Jun 2004
An article on creating an AppWizard to create Win32 based applications.
win32appwiz_src.zip
SimpleApplicationWizard
hlp
SIMPLEAPPLICATIONWIZARD.HLP
SimpleApplicationWizard.hm
SimpleApplicationWizard.hpj
SimpleApplicationWizard.LOG
SimpleApplicationWizard.ph
SimpleApplicationWizard.rtf
res
SimpleApplicationWizard.ico
SimpleApplicationWizard.dsp
SimpleApplicationWizard.dsw
Template
confirm.inf
newproj.inf
// cstm1dlg.cpp : implementation file
//

#include "stdafx.h"
#include "SimpleApplicationWizard.h"
#include "cstm1dlg.h"
#include "SimpleApplicationWizardaw.h"

#ifdef _PSEUDO_DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCustom1Dlg dialog


CCustom1Dlg::CCustom1Dlg()
	: CAppWizStepDlg(CCustom1Dlg::IDD)
{
	//{{AFX_DATA_INIT(CCustom1Dlg)
	m_bInitCommonControls = FALSE;
	m_bUseWinsock = FALSE;
	//}}AFX_DATA_INIT

	OnRadioWindowBased();
}


void CCustom1Dlg::DoDataExchange(CDataExchange* pDX)
{
	CAppWizStepDlg::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCustom1Dlg)
	DDX_Check(pDX, IDC_CHECK_INIT_COMMON_CONTROLS, m_bInitCommonControls);
	DDX_Check(pDX, IDC_CHECK_USE_WINSOCK, m_bUseWinsock);
	//}}AFX_DATA_MAP
}

// This is called whenever the user presses Next, Back, or Finish with this step
//  present.  Do all validation & data exchange from the dialog in this function.
BOOL CCustom1Dlg::OnDismiss()
{
	if (!UpdateData(TRUE))
		return FALSE;

	if(!m_bWindowBased){
		
		SimpleApplicationWizardaw.m_Dictionary.SetAt("DIALOG_BASED","Yes");
		SimpleApplicationWizardaw.m_Dictionary.RemoveKey("WINDOW_BASED");
	}else{
		SimpleApplicationWizardaw.m_Dictionary.SetAt("WINDOW_BASED","Yes");
		SimpleApplicationWizardaw.m_Dictionary.RemoveKey("DIALOG_BASED");
	}

	if(m_bInitCommonControls)
	{
		SimpleApplicationWizardaw.m_Dictionary.SetAt("INIT_COMMON_CONTROLS","Yes");
	}
	else
	{
		SimpleApplicationWizardaw.m_Dictionary.RemoveKey("INIT_COMMON_CONTROLS");
	}

	if(m_bUseWinsock)
	{
		SimpleApplicationWizardaw.m_Dictionary.SetAt("USE_WINSOCK","Yes");
	}
	else
	{
		SimpleApplicationWizardaw.m_Dictionary.RemoveKey("USE_WINSOCK");
	}

	return TRUE;	// return FALSE if the dialog shouldn't be dismissed
}


BEGIN_MESSAGE_MAP(CCustom1Dlg, CAppWizStepDlg)
	//{{AFX_MSG_MAP(CCustom1Dlg)
	ON_BN_CLICKED(IDC_RADIO_DIALOG_BASED, OnRadioDialogBased)
	ON_BN_CLICKED(IDC_RADIO_WINDOW_BASED, OnRadioWindowBased)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CCustom1Dlg message handlers

void CCustom1Dlg::OnRadioDialogBased() 
{
	m_bWindowBased = FALSE;
}

void CCustom1Dlg::OnRadioWindowBased() 
{
	m_bWindowBased = TRUE;
}

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

Share

About the Author

Fabio Fornaro
Software Developer (Senior)
Italy Italy
Worked as a Java developer targeting J2EE and J2SE for half a decade.
 
Now he's employed for Avanade as a Senior Associate Consultant on Microsoft technologies.
 
His hobbies are Win32 programming using SDK, MFC, ATL and COM; playing guitar and listening to music.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1411023.1 | Last Updated 23 Jun 2004
Article Copyright 2004 by Fabio Fornaro
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid