Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.2 KiB

  1. #ifndef _VARIABLE_INC_
  2. #define _VARIABLE_INC_
  3. /*=============================================================================
  4. |
  5. | File: dmotest.h
  6. |
  7. | Copyright (c) 2000 Microsoft Corporation. All rights reserved
  8. |
  9. | Abstract:
  10. | Example of deriving of CTreeModule and CTestNodeItem classes to create
  11. | a test application with the ability to pass variables to the test functions
  12. |
  13. | Contents:
  14. |
  15. |
  16. | History:
  17. | 5/1/2000 wendyliu First version
  18. |
  19. \============================================================================*/
  20. #include <windows.h>
  21. #include <treemod.h>
  22. /*=============================================================================
  23. | RESOURCES
  24. \============================================================================*/
  25. #define APPICON 101
  26. #define ITEM_COUNT 100
  27. #define NUM_OF_DMO_SUBITEM_COLUMN 3
  28. #define NUM_OF_FILE_SUBITEM_COLUMN 1
  29. #define MAX_LEN 255
  30. #define MAX_NUM 50
  31. #define TX_NO_OF_COMPONENTS_ENTRY "No of Components"
  32. #define TX_NO_OF_SELECTED_COMPONENTS_ENTRY "No of Selected Components"
  33. #define TX_COMPONENT_ENTRY "Component Name"
  34. #define TX_CLASSID_ENTRY "Class ID"
  35. #define TX_SELECTED_FOR_TEST "Selected for Test"
  36. #define TX_NO_OF_TEST_FILES_ENTRY "No of Test Files"
  37. #define TX_FILENAME_ENTRY "Input File Name"
  38. #define TX_NOT_EXIST "Not Exist"
  39. class CTestNodeItem;
  40. class CDmoTestCase;
  41. //typedef CTestNodeItem *PCTestNodeItem;
  42. //typedef PCTestNodeItem *PPCTestNodeItem;
  43. typedef CDmoTestCase *PCDmoTestCase;
  44. typedef PCDmoTestCase *PPCDmoTestCase;
  45. //the type of function that will be called by RunTest
  46. typedef DWORD (*DMOTESTFNPROC1)(LPSTR pszVar1, LPSTR pszVar2);
  47. typedef DWORD (*DMOTESTFNPROC2)(LPSTR pszVar1);
  48. /*=============================================================================
  49. | CLASS DEFINITIONS
  50. \============================================================================*/
  51. /*-----------------------------------------------------------------------------
  52. | Class: CDmoTest
  53. | Purpose: Derive CTestModule for more reusable form
  54. | Notes: This is admittedly not the best implementation but the
  55. | interface is what matters. Most of the functions are wrappers
  56. | for functionality provided by CTestNodeItem and its
  57. | derivitives.
  58. \----------------------------------------------------------------------------*/
  59. class CDmoTest : public CTreeModule
  60. {
  61. private:
  62. char m_szScriptFileName[256];
  63. protected:
  64. //wrapper for AddCase in this module
  65. void AddCase(LPSTR pszCaseID, LPSTR pszName, DMOTESTFNPROC1 pfnTest, CDmoTest* dmoTest);
  66. //overloaded variable passing version of AddCase
  67. void AddCase(LPSTR pszCaseID, LPSTR pszName, DMOTESTFNPROC2 pfnTest, CDmoTest* dmoTest);
  68. // Defined for each module by user
  69. virtual void InitCaseTree();
  70. public:
  71. CDmoTest(CTestShell* pShell, HINSTANCE hInstDLL);
  72. virtual ~CDmoTest(void);
  73. // event display dialog proc
  74. static INT_PTR CALLBACK SelectDmoDialogProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);
  75. static INT_PTR CALLBACK SelectTestFileDialogProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);
  76. static INT_PTR CALLBACK MediaTypeDialogProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);
  77. static INT_PTR CALLBACK DataGenDialogProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);
  78. DWORD LoadSettings(LPSTR pszFileName, LPSTR pszSetction);
  79. DWORD SaveSettings(LPSTR pszFileName, LPSTR pszSetction);
  80. BOOL InitListView(HWND hListView);
  81. BOOL InitTestFileListView(HWND hListView);
  82. virtual DWORD Initialize(void);
  83. DWORD RunTest(DWORD dwTestID);
  84. DWORD OnInitialUpdate(void);
  85. void ProcessMenuItem(DWORD nID, HWND hWndCtl, DWORD codeNotify, HMENU hOptionMenu);
  86. int GetNumComponent();
  87. LPSTR GetDmoName(int index);
  88. LPSTR GetDmoClsid(int index);
  89. BOOL IsDmoSelected(int index);
  90. int GetNumTestFile(int index);
  91. LPSTR GetFileName(int comIndex, int fileIndex);
  92. HWND GetWindowHandle();
  93. int GetNumSelectedDmo();
  94. static HWND m_hSelectDmoDlg;
  95. static HWND m_hSelectFilesDlg;
  96. static HWND m_hMediaTypeDlg;
  97. static HWND m_hDataGenDlg;
  98. HWND m_hDmoList;
  99. HWND m_hTestFileList;
  100. HWND m_hMediaTypeList;
  101. HWND m_hInputFileField;
  102. HWND m_hOutputFileField;
  103. };
  104. #endif