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.

166 lines
5.2 KiB

  1. //
  2. // MODULE: TSHOOTCTL.H
  3. //
  4. // PURPOSE: Declaration of the CTSHOOTCtrl OLE control class.
  5. //
  6. // PROJECT: Generic Troubleshooter DLL for Microsoft AnswerPoint
  7. //
  8. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  9. //
  10. // AUTHOR: Roman Mach
  11. // further work by Richard Meadows (RWM), Joe Mabel
  12. //
  13. // ORIGINAL DATE: 8/7/97
  14. //
  15. // NOTES:
  16. // 1.
  17. //
  18. // Version Date By Comments
  19. //--------------------------------------------------------------------
  20. // V0.2 8/7/97 RM Local Version for Memphis
  21. // V0.3 3/24/98 JM Local Version for NT5
  22. //
  23. // INI section header
  24. #define TSINI_GROUP_STR _T("[TSLocalDownload.V1]")
  25. // file types (maps to sub key lists)
  26. #define TSINI_TYPE_TS _T("TS")
  27. #define TSINI_TYPE_SF _T("SF")
  28. // parameter offset in INI
  29. #define TSINI_OFFSET_TYPE 0
  30. #define TSINI_OFFSET_FILENAME 1
  31. #define TSINI_OFFSET_VERSION 2
  32. #define TSINI_OFFSET_FRIENDLY 3
  33. //
  34. #define TSINI_LINE_PARAM_COUNT 4
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CTSHOOTCtrl : See TSHOOTCtl.cpp for implementation.
  37. // Roman Mach believes (3/14/98) that there is exactly one object of this type in the Local
  38. // Troubleshooter and that this object persists intact as we move from node to node within
  39. // a troubleshooting belief network. (This may not be strictly true if the "Download"
  40. // feature is used.) Since this class can be DYNCREATEd it's hard to verify this definitively.
  41. class CTSHOOTCtrl : public COleControl
  42. {
  43. #define PRELOAD_LIBRARY _T("apgts.dll?preload=")
  44. DECLARE_DYNCREATE(CTSHOOTCtrl)
  45. // Constructor
  46. public:
  47. CTSHOOTCtrl();
  48. VOID StatusEventHelper( DLITEMTYPES dwItem,
  49. DLSTATTYPES dwStat,
  50. DWORD dwExtended = 0,
  51. BOOL bComplete = FALSE);
  52. VOID ProgressEventHelper( DLITEMTYPES dwItem, ULONG ulCurr, ULONG ulTotal );
  53. DLSTATTYPES ProcessReceivedData(DLITEMTYPES dwItem, TCHAR *pData, UINT uLen);
  54. const CString GetListPath();
  55. // Overrides
  56. // ClassWizard generated virtual function overrides
  57. //{{AFX_VIRTUAL(CTSHOOTCtrl)
  58. public:
  59. virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  60. virtual void DoPropExchange(CPropExchange* pPX);
  61. virtual void OnResetState();
  62. //}}AFX_VIRTUAL
  63. // Implementation
  64. protected:
  65. ~CTSHOOTCtrl();
  66. CString m_strCurShooter;
  67. APGTSContext m_apgts;
  68. CDBLoadConfiguration m_Conf;
  69. CHttpQuery m_httpQuery;
  70. DECLARE_OLECREATE_EX(CTSHOOTCtrl) // Class factory and guid
  71. DECLARE_OLETYPELIB(CTSHOOTCtrl) // GetTypeInfo
  72. DECLARE_PROPPAGEIDS(CTSHOOTCtrl) // Property page IDs
  73. DECLARE_OLECTLTYPE(CTSHOOTCtrl) // Type name and misc status
  74. // Message maps
  75. //{{AFX_MSG(CTSHOOTCtrl)
  76. // NOTE - ClassWizard will add and remove member functions here.
  77. // DO NOT EDIT what you see in these blocks of generated code !
  78. //}}AFX_MSG
  79. DECLARE_MESSAGE_MAP()
  80. // Dispatch maps
  81. //{{AFX_DISPATCH(CTSHOOTCtrl)
  82. CString m_downloadURL;
  83. afx_msg void OnDownloadURLChanged();
  84. CString m_downloadListFilename;
  85. afx_msg void OnDownloadListFilenameChanged();
  86. afx_msg BSTR RunQuery(const VARIANT FAR& varCmds, const VARIANT FAR& varVals, short size);
  87. afx_msg bool SetSniffResult(const VARIANT FAR& varNodeName, const VARIANT FAR& varState);
  88. afx_msg long GetExtendedError();
  89. afx_msg BSTR GetCurrentFriendlyDownload();
  90. afx_msg BSTR GetCurrentFileDownload();
  91. afx_msg long DownloadAction(long dwActionType);
  92. afx_msg BSTR BackUp();
  93. afx_msg BSTR ProblemPage();
  94. afx_msg BSTR PreLoadURL(LPCTSTR szRoot);
  95. afx_msg BSTR Restart();
  96. afx_msg BSTR RunQuery2(LPCTSTR szTopic, LPCTSTR szCmd, LPCTSTR szVal);
  97. afx_msg void SetPair(LPCTSTR szName, LPCTSTR szValue);
  98. //}}AFX_DISPATCH
  99. DECLARE_DISPATCH_MAP()
  100. afx_msg void AboutBox();
  101. // Event maps
  102. //{{AFX_EVENT(CTSHOOTCtrl)
  103. void FireBindProgress(LPCTSTR sFile, long ulCurr, long ulTotal)
  104. {FireEvent(eventidBindProgress,EVENT_PARAM(VTS_BSTR VTS_I4 VTS_I4), sFile, ulCurr, ulTotal);}
  105. void FireBindStatus(long uItem, long uStat, long uExtended, BOOL bComplete)
  106. {FireEvent(eventidBindStatus,EVENT_PARAM(VTS_I4 VTS_I4 VTS_I4 VTS_BOOL), uItem, uStat, uExtended, bComplete);}
  107. void FireSniffing(LPCTSTR strMachine, LPCTSTR strPNPDevice, LPCTSTR strDeviceInstance, LPCTSTR strClassGuid)
  108. {FireEvent(eventidSniffing,EVENT_PARAM(VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR), strMachine, strPNPDevice, strDeviceInstance, strClassGuid);}
  109. //}}AFX_EVENT
  110. DECLARE_EVENT_MAP()
  111. // Dispatch and event IDs
  112. public:
  113. enum {
  114. //{{AFX_DISP_ID(CTSHOOTCtrl)
  115. dispidDownloadURL = 1L,
  116. dispidDownloadListFilename = 2L,
  117. dispidRunQuery = 3L,
  118. dispidSetSniffResult = 4L,
  119. dispidGetExtendedError = 5L,
  120. dispidGetCurrentFriendlyDownload = 6L,
  121. dispidGetCurrentFileDownload = 7L,
  122. dispidDownloadAction = 8L,
  123. dispidBackUp = 9L,
  124. dispidProblemPage = 10L,
  125. dispidPreLoadURL = 11L,
  126. dispidRestart = 12L,
  127. dispidRunQuery2 = 13L,
  128. dispidSetPair = 14L,
  129. eventidBindProgress = 1L,
  130. eventidBindStatus = 2L,
  131. eventidSniffing = 3L,
  132. //}}AFX_DISP_ID
  133. };
  134. protected:
  135. DLSTATTYPES ProcessINI(TCHAR *pData);
  136. DLSTATTYPES ProcessDSC(TCHAR *pData, UINT uLen);
  137. BOOL FileRegCheck(CString &sType, CString &sFilename, CString &sKeyName, DWORD dwCurrVersion);
  138. DLSTATTYPES GetPathToFiles();
  139. protected:
  140. BOOL m_bComplete;
  141. CDownload *m_download;
  142. CDnldObjList m_dnldList;
  143. DWORD m_dwExtendedErr;
  144. CString m_sBasePath;
  145. CSniffedNodeContainer* m_pSniffedContainer; // pointer to container to save results of sniffing
  146. };