home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / customaw.h < prev    next >
C/C++ Source or Header  |  1998-05-05  |  4KB  |  119 lines

  1. #ifndef __CUSTOMAW_H__
  2. #define __CUSTOMAW_H__
  3.  
  4. #include <afxdisp.h>
  5. #include <ObjModel\appauto.h>
  6. #include <ObjModel\bldauto.h>
  7.  
  8. /////////////////////////////////////////////////////////////////////////////
  9. // customaw.h -- Header file to be included by all custom AppWizards.
  10.  
  11.  
  12. /////////////////////////////////////////////////////////////////////////////
  13. // Defines for exporting from AppWizard & importing into extensions
  14. // TODO: Delete this
  15.  
  16. #pragma warning(disable: 4275)
  17. #pragma warning(disable: 4251)
  18.  
  19. #ifndef _APWZEXT
  20.     #ifdef _DEBUG
  21.         #pragma comment(lib, "mfcapwzd.lib")
  22.     #else
  23.         #pragma comment(lib, "mfcapwz.lib")
  24.     #endif
  25. #endif
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Class CAppWizStepDlg-- all custom AppWizard steps must derive from
  29. //  this class
  30.  
  31. class CAppWizStepDlg : public CDialog
  32. {
  33. public:
  34.     CAppWizStepDlg(UINT nIDTemplate);
  35.     ~CAppWizStepDlg();
  36.     virtual BOOL OnDismiss();
  37.  
  38.     // You will probably not want to override or call this function.  It is
  39.     //  overridden (for CAppWizStepDlg) in MFCAPWZ.DLL to handle tabbing from
  40.     //  the dialog controls in CAppWizStepDlg to the outer AppWizard dialog's
  41.     //  controls.
  42.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  43.  
  44.     // You will probably not want to override or call this function.  It is
  45.     //  overridden (for CAppWizStepDlg) in MFCAPWZ.DLL to dynamically change
  46.     //  the dialog template's font to match the rest of the IDE.
  47.     virtual BOOL Create(UINT nIDTemplate, CWnd* pParentWnd = NULL);
  48.  
  49.     UINT m_nIDTemplate;
  50. };
  51.  
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // class OutputStream-- this abstract class is used to funnel output while
  55. //  parsing templates.
  56.  
  57. class OutputStream
  58. {
  59. public:
  60.     virtual void WriteLine(LPCTSTR lpsz) = 0;
  61.     virtual void WriteBlock(LPCTSTR pBlock, DWORD dwSize) = 0;
  62. };
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // Class CCustomAppWiz-- all custom AppWizards must have a class derived from
  66. //  this.  MFCAPWZ.DLL talks to the custom AppWizard by calling these virtual
  67. //  functions.
  68.  
  69. class CCustomAppWiz : public CObject
  70. {
  71. public:
  72.     CMapStringToString m_Dictionary;
  73.  
  74.     virtual void GetPlatforms(CStringList& rPlatforms) {}
  75.  
  76.     virtual CAppWizStepDlg* Next(CAppWizStepDlg* pDlg) { return NULL; }
  77.     virtual CAppWizStepDlg* Back(CAppWizStepDlg* pDlg) { return NULL; }
  78.  
  79.     virtual void InitCustomAppWiz() { m_Dictionary.RemoveAll(); }
  80.     virtual void ExitCustomAppWiz() {}
  81.  
  82.     virtual LPCTSTR LoadTemplate(LPCTSTR lpszTemplateName,
  83.         DWORD& rdwSize, HINSTANCE hInstance = NULL);
  84.  
  85.     virtual void CopyTemplate(LPCTSTR lpszInput, DWORD dwSize, OutputStream* pOutput);
  86.     virtual void ProcessTemplate(LPCTSTR lpszInput, DWORD dwSize, OutputStream* pOutput);
  87.     virtual void PostProcessTemplate(LPCTSTR szTemplate) {}
  88.     
  89.     virtual void CustomizeProject(IBuildProject* pProject) {}
  90. };
  91.  
  92.  
  93. /////////////////////////////////////////////////////////////////////////////
  94. // C API's exported by AppWizard.  The custom AppWizard talks to MFCAPWZ.DLL
  95. //  by calling these functions.
  96.  
  97. // Values to be passed to GetDialog()
  98. enum AppWizDlgID
  99. {
  100.     APWZDLG_APPTYPE = 1,
  101.     APWZDLG_DATABASE,
  102.     APWZDLG_OLE,
  103.     APWZDLG_DOCAPPOPTIONS,
  104.     APWZDLG_PROJOPTIONS,
  105.     APWZDLG_CLASSES,
  106.     APWZDLG_DLGAPPOPTIONS,
  107.     APWZDLG_DLLPROJOPTIONS,
  108. };
  109.  
  110. void SetCustomAppWizClass(CCustomAppWiz* pAW);
  111. CAppWizStepDlg* GetDialog(AppWizDlgID nID);
  112. void SetNumberOfSteps(int nSteps);
  113. BOOL ScanForAvailableLanguages(CStringList& rLanguages);
  114. void SetSupportedLanguages(LPCTSTR szSupportedLangs);
  115. HRESULT FindInterface(REFIID riid, LPVOID FAR* ppvObj);
  116.  
  117.  
  118. #endif //__CUSTOMAW_H__
  119.