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.

177 lines
5.1 KiB

  1. // MainFrm.h : interface of the CMainFrame class
  2. //
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1997-1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. /////////////////////////////////////////////////////////////////////////////
  12. class CMainFrame : public CFrameWnd
  13. {
  14. protected: // create from serialization only
  15. CMainFrame();
  16. DECLARE_DYNCREATE(CMainFrame)
  17. // Attributes
  18. public:
  19. // Operations
  20. public:
  21. // Overrides
  22. // ClassWizard generated virtual function overrides
  23. //{{AFX_VIRTUAL(CMainFrame)
  24. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  25. //}}AFX_VIRTUAL
  26. // Implementation
  27. public:
  28. virtual ~CMainFrame();
  29. #ifdef _DEBUG
  30. virtual void AssertValid() const;
  31. virtual void Dump(CDumpContext& dc) const;
  32. #endif
  33. protected: // control bar embedded members
  34. CStatusBar m_wndStatusBar;
  35. CToolBar m_wndToolBar;
  36. // Generated message map functions
  37. protected:
  38. //{{AFX_MSG(CMainFrame)
  39. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  40. afx_msg void OnApiCreateQueue();
  41. afx_msg void OnApiDeleteQueue();
  42. afx_msg void OnApiOpenQueue();
  43. afx_msg void OnApiCloseQueue();
  44. afx_msg void OnApiSendMessage();
  45. afx_msg void OnApiReceiveMessage();
  46. afx_msg void OnApiLocate();
  47. //}}AFX_MSG
  48. DECLARE_MESSAGE_MAP()
  49. protected:
  50. void OnUpdateFrameTitle(BOOL bAddToTitle);
  51. protected:
  52. //
  53. // An array to hold the pathnames of the queues that were created so far.
  54. //
  55. //
  56. // Holds information about all "located" queues
  57. //
  58. CArray<ARRAYQ*, ARRAYQ*> m_PathNameArray;
  59. //
  60. // Holds information about all "opened" queues
  61. //
  62. CArray<ARRAYQ*, ARRAYQ*> m_OpenedQueuePathNameArray;
  63. public:
  64. //
  65. // Utility function to display status string based on received msg Class property
  66. //
  67. void ClassToString(unsigned short MsgClass,LPTSTR pszStatus);
  68. //
  69. // functions to manipulate the path names array.
  70. //
  71. //
  72. // Adds a given ARRAYQ pointer to the PathName array.
  73. //
  74. void Add2PathNameArray(ARRAYQ* NewPath) {m_PathNameArray.Add(NewPath);}
  75. //
  76. // Removes an ARRAYQ pointer whose pathname matches
  77. // the given pathname form the PathName array.
  78. //
  79. ARRAYQ* RemoveFromPathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN]);
  80. //
  81. // Empties the PathName array and frees all allocated memory.
  82. //
  83. void CleanPathNameArray();
  84. //
  85. // Looks for an ARRAYQ pointer whose pathname matches the given one,
  86. // and returns the formatname of that ARRAYQ.
  87. //
  88. BOOL TranslatePathNameToFormatName(TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  89. TCHAR szFormatName[MAX_Q_FORMATNAME_LEN]);
  90. //
  91. // Prints to screen the pathname of all ARRAYQ's in the PathName array.
  92. //
  93. void DisplayPathNameArray();
  94. //
  95. // functions to manipulate the opened queues path name array.
  96. //
  97. //
  98. // Adds a given ARRAYQ pointer to the Opened Queue PathName array.
  99. //
  100. void Add2OpenedQueuePathNameArray(ARRAYQ* NewPath)
  101. {m_OpenedQueuePathNameArray.Add(NewPath);}
  102. //
  103. // Removes an ARRAYQ pointer whose pathname matches
  104. // the given pathname form the Opened Queue PathName array.
  105. //
  106. ARRAYQ* RemoveFromOpenedQueuePathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN]);
  107. //
  108. // Checks if the Opened Queue PathName array is Empty.
  109. //
  110. BOOL IsOpenedQueueArrayEmpty();
  111. //
  112. // Looks for an ARRAYQ pointer whose pathname matches the given one,
  113. // and returns the formatname of that ARRAYQ.
  114. //
  115. BOOL TranslateOpenedQueuePathNameToFormatName(
  116. TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  117. TCHAR szFormatName[MAX_Q_FORMATNAME_LEN]);
  118. //
  119. // Looks for an ARRAYQ pointer whose pathname matches the given one,
  120. // and returns the Queue Handle of that ARRAYQ.
  121. //
  122. BOOL GetQueueHandle(TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  123. QUEUEHANDLE* phClosedQueueHandle);
  124. //
  125. // Prints to screen the pathname of all ARRAYQ's in the PathName array.
  126. //
  127. void DisplayOpenedQueuePathNameArray();
  128. //
  129. // functions to manipulate both of the queues.
  130. //
  131. //
  132. // Moves an ARRAYQ pointer from the PathName array to the Opened Queue PathName array.
  133. //
  134. void MoveToOpenedQueuePathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  135. QUEUEHANDLE hQueue, DWORD dwAccess);
  136. //
  137. // Moves an ARRAYQ pointer from the Opened Queue PathName array array to the PathName.
  138. //
  139. void MoveToPathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN]);
  140. //
  141. // Looks for ARRAYQ's that are found in both arrays
  142. // and removes them from the PathName array.
  143. //
  144. void UpdatePathNameArrays();
  145. };
  146. extern "C" void PrintToScreen(const TCHAR * Format, ...);
  147. extern CWnd* pMainView;
  148. /////////////////////////////////////////////////////////////////////////////