📄 shiconwzaw.cpp
字号:
// shiconwzaw.cpp : implementation file
//
#include "stdafx.h"
#include "shiconwz.h"
#include "shiconwzaw.h"
#include <objbase.h>
#include <afxpriv.h>
#ifdef _PSEUDO_DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// This is called immediately after the custom AppWizard is
// loaded. Initialize the state of the custom AppWizard here.
void CShiconwzAppWiz::InitCustomAppWiz()
{
// There are no steps in this custom AppWizard.
SetNumberOfSteps(1);
// Inform AppWizard that we're making a DLL.
m_Dictionary[_T("PROJTYPE_DLL")] = _T("1");
// TODO: Add any other custom AppWizard-wide initialization here.
char clsid[66],part[66];
GUID g;
LPOLESTR str;
CoCreateGuid(&g);
StringFromCLSID(g,&str);
USES_CONVERSION;
strcpy(clsid,W2A(str));
// Set up CLSID in various ways in the dictionary
m_Dictionary[_T("EXT_CLSID")]=_T(clsid);
strcpy(part,"0x");
clsid[9]='\0';
strcpy(part+2,clsid+1);
m_Dictionary[_T("CLSID_P1")]=_T(part);
clsid[14]='\0';
strcpy(part+2,clsid+10);
m_Dictionary[_T("CLSID_P2")]=_T(part);
clsid[19]='\0';
strcpy(part+2,clsid+15);
m_Dictionary[_T("CLSID_P3")]=_T(part);
part[2]=clsid[20];
part[3]=clsid[21];
strcpy(part+4,",0x");
part[7]=clsid[22];
part[8]=clsid[23];
for (int i=0;i<6;i++)
{
strcpy(part+9+5*i,",0x");
part[9+5*i+3]=clsid[25+i*2];
part[9+5*i+4]=clsid[26+i*2];
}
part[39]='\0';
m_Dictionary[_T("CLSID_P4")]=_T(part);
}
// This is called just before the custom AppWizard is unloaded.
void CShiconwzAppWiz::ExitCustomAppWiz()
{
// TODO: Add code here to deallocate resources
// used by the custom AppWizard
}
// This is called when the user clicks "Create..." on the
// New Project dialog or next
CAppWizStepDlg* CShiconwzAppWiz::Next(CAppWizStepDlg* pDlg)
{
// Set template macros based on the project name entered by the user.
// Get value of $$root$$ (already set by AppWizard)
if (pDlg==NULL) // first time
{
CString strRoot;
m_Dictionary.Lookup(_T("root"), strRoot);
// Set value of $$Doc$$, $$DOC$$
CString strDoc = strRoot.Left(6);
m_Dictionary[_T("Doc")] = strDoc;
strDoc.MakeUpper();
m_Dictionary[_T("DOC")] = strDoc;
// Set value of $$MAC_TYPE$$
strRoot = strRoot.Left(4);
int nLen = strRoot.GetLength();
if (strRoot.GetLength() < 4)
{
CString strPad(_T(' '), 4 - nLen);
strRoot += strPad;
}
strRoot.MakeUpper();
m_Dictionary[_T("MAC_TYPE")] = strRoot;
return &step_1; // bring up step 1
}
// only 1 step so we are done if we get here (and we
// should never get here). The step_1 dialog updates
// the dictionary
return NULL;
}
// Here we define one instance of the CShiconwzAppWiz class.
// You can access m_Dictionary and any other public members
// of this class through the global Shiconwzaw.
CShiconwzAppWiz Shiconwzaw;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -