📄 aboutwizaw.cpp
字号:
// AboutWizAW.cpp : implementation file
//
#include "stdafx.h"
#include "AboutWiz.h"
#include "AboutWizAW.h"
#include "chooser.h"
#include "registry.h"
#ifdef _PSEUDO_DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define ABOUTWIZ_KEY "Software\\Special K Software\\AboutWiz"
static struct
{
char szMacroName[50];
char szRegistryValueName[50];
char szMacroDefaultValue[50];
} macroPairs[] = {
"PROGRAMMER", "Programmer", "Programmer Name",
"GENERAL_INFO", "General Info", "App Desc",
"WEB_PAGE", "Web Page", "Web Page"
};
// This is called immediately after the custom AppWizard is loaded. Initialize
// the state of the custom AppWizard here.
void CAboutWizAppWiz::InitCustomAppWiz()
{
// Create a new dialog chooser; CDialogChooser's constructor initializes
// its internal array with pointers to the steps.
m_pChooser = new CDialogChooser;
// At first, we don't know the total number of steps, since there are two
// possible "tracks" (MDI/SDI app and dialog-based app).
SetNumberOfSteps(-1);
// Inform AppWizard of the languages we support
SetSupportedLanguages(_T("German [Standard] (APPWZDEU.DLL);0x40704b0\nEnglish [United States] (APPWZENU.DLL);0x40904b0\nSpanish [Modern Sort] (APPWZESP.DLL);0xc0a04b0\nFrench [Standard] (APPWZFRA.DLL);0x40c04b0\nItalian [Standard] (APPWZITA.DLL);0x41004b0"));
// TODO: Add any other custom AppWizard-wide initialization here.
CRegistry registry(HKEY_LOCAL_MACHINE, ABOUTWIZ_KEY);
CString strValue;
for (int i = 0; i < sizeof macroPairs / sizeof macroPairs[0]; i++)
{
if (registry.ReadString(macroPairs[i].szRegistryValueName, strValue.GetBuffer(strValue.GetLength())))
{
m_Dictionary.SetAt(macroPairs[i].szMacroName, strValue);
}
else
{
m_Dictionary.SetAt(macroPairs[i].szMacroName, macroPairs[i].szMacroDefaultValue);
if (m_Dictionary.Lookup(macroPairs[i].szMacroName, strValue))
{
registry.WriteString(macroPairs[i].szRegistryValueName, strValue.GetBuffer(strValue.GetLength()));
}
}
}
}
// This is called just before the custom AppWizard is unloaded.
void CAboutWizAppWiz::ExitCustomAppWiz()
{
// Deallocate memory used for the dialog chooser
ASSERT(m_pChooser != NULL);
delete m_pChooser;
m_pChooser = NULL;
// TODO: Add code here to deallocate resources used by the custom AppWizard
CRegistry registry(HKEY_LOCAL_MACHINE, ABOUTWIZ_KEY);
CString strValue;
for (int i = 0; i < sizeof macroPairs / sizeof macroPairs[0]; i++)
{
if (m_Dictionary.Lookup(macroPairs[i].szMacroName, strValue))
{
registry.WriteString(macroPairs[i].szRegistryValueName, strValue.GetBuffer(strValue.GetLength()));
}
}
}
// This is called when the user clicks "Create..." on the New Project dialog
// or "Next" on one of the custom AppWizard's steps.
CAppWizStepDlg* CAboutWizAppWiz::Next(CAppWizStepDlg* pDlg)
{
// Delegate to the dialog chooser
return m_pChooser->Next(pDlg);
}
// This is called when the user clicks "Back" on one of the custom
// AppWizard's steps.
CAppWizStepDlg* CAboutWizAppWiz::Back(CAppWizStepDlg* pDlg)
{
// Delegate to the dialog chooser
return m_pChooser->Back(pDlg);
}
void CAboutWizAppWiz::CustomizeProject(IBuildProject* pProject)
{
// TODO: Add code here to customize the project. If you don't wish
// to customize project, you may remove this virtual override.
// This is called immediately after the default Debug and Release
// configurations have been created for each platform. You may customize
// existing configurations on this project by using the methods
// of IBuildProject and IConfiguration such as AddToolSettings,
// RemoveToolSettings, and AddCustomBuildStep. These are documented in
// the Developer Studio object model documentation.
// WARNING!! IBuildProject and all interfaces you can get from it are OLE
// COM interfaces. You must be careful to release all new interfaces
// you acquire. In accordance with the standard rules of COM, you must
// NOT release pProject, unless you explicitly AddRef it, since pProject
// is passed as an "in" parameter to this function. See the documentation
// on CCustomAppWiz::CustomizeProject for more information.
}
// Here we define one instance of the CAboutWizAppWiz class. You can access
// m_Dictionary and any other public members of this class through the
// global AboutWizAW.
CAboutWizAppWiz AboutWizAW;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -