home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / msmqocm.cab / mainfrm.h < prev    next >
C/C++ Source or Header  |  1997-10-06  |  5KB  |  168 lines

  1. // MainFrm.h : interface of the CMainFrame class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5.  
  6. class CMainFrame : public CFrameWnd
  7. {
  8. protected: // create from serialization only
  9.     CMainFrame();
  10.     DECLARE_DYNCREATE(CMainFrame)
  11.  
  12. // Attributes
  13. public:
  14.  
  15. // Operations
  16. public:
  17.  
  18. // Overrides
  19.     // ClassWizard generated virtual function overrides
  20.     //{{AFX_VIRTUAL(CMainFrame)
  21.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  22.     //}}AFX_VIRTUAL
  23.  
  24. // Implementation
  25. public:
  26.     virtual ~CMainFrame();
  27. #ifdef _DEBUG
  28.     virtual void AssertValid() const;
  29.     virtual void Dump(CDumpContext& dc) const;
  30. #endif
  31.  
  32. protected:  // control bar embedded members
  33.     CStatusBar  m_wndStatusBar;
  34.     CToolBar    m_wndToolBar;
  35.  
  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.  
  50. protected:
  51.  
  52.     void OnUpdateFrameTitle(BOOL bAddToTitle);
  53.  
  54. protected:
  55.     //
  56.     // An array to hold the pathnames of the queues that were created so far.
  57.     //
  58.  
  59.     //
  60.     // Holds information about all "located" queues
  61.     //
  62.     CArray<ARRAYQ*, ARRAYQ*> m_PathNameArray;
  63.  
  64.     //
  65.     // Holds information about all "opened" queues
  66.     //
  67.     CArray<ARRAYQ*, ARRAYQ*> m_OpenedQueuePathNameArray;
  68.  
  69. public:
  70.  
  71.     //
  72.     // Utility function to display status string based on received msg Class property
  73.     //
  74.     void ClassToString(unsigned short MsgClass,LPTSTR pszStatus);
  75.  
  76.  
  77.  
  78.     //
  79.     // functions to manipulate the path names array.
  80.     //
  81.  
  82.     //
  83.     // Adds a given ARRAYQ pointer to the PathName array.
  84.     //
  85.     void Add2PathNameArray(ARRAYQ* NewPath) {m_PathNameArray.Add(NewPath);}
  86.     //
  87.     // Removes an ARRAYQ pointer whose pathname matches
  88.     // the given pathname form the PathName array.
  89.     //
  90.     ARRAYQ* RemoveFromPathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN]);
  91.     //
  92.     // Empties the PathName array and frees all allocated memory.
  93.     //
  94.     void CleanPathNameArray();
  95.     //
  96.     // Looks for an ARRAYQ pointer whose pathname matches the given one,
  97.     // and returns the formatname of that ARRAYQ.
  98.     //
  99.     BOOL TranslatePathNameToFormatName(TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  100.                                        TCHAR szFormatName[MAX_Q_FORMATNAME_LEN]);
  101.     //
  102.     // Prints to screen the pathname of all ARRAYQ's in the PathName array.
  103.     //
  104.     void DisplayPathNameArray();
  105.  
  106.     //
  107.     // functions to manipulate the opened queues path name array.
  108.     //
  109.     
  110.     //
  111.     // Adds a given ARRAYQ pointer to the Opened Queue PathName array.
  112.     //
  113.     void Add2OpenedQueuePathNameArray(ARRAYQ* NewPath)
  114.                                             {m_OpenedQueuePathNameArray.Add(NewPath);}
  115.     //
  116.     // Removes an ARRAYQ pointer whose pathname matches
  117.     // the given pathname form the Opened Queue PathName array.
  118.     //
  119.     ARRAYQ* RemoveFromOpenedQueuePathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN]);
  120.     //
  121.     // Checks if the Opened Queue PathName array is Empty.
  122.     //
  123.     BOOL IsOpenedQueueArrayEmpty();
  124.     //
  125.     // Looks for an ARRAYQ pointer whose pathname matches the given one,
  126.     // and returns the formatname of that ARRAYQ.
  127.     //
  128.     BOOL TranslateOpenedQueuePathNameToFormatName(
  129.                                            TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  130.                                            TCHAR szFormatName[MAX_Q_FORMATNAME_LEN]);
  131.     //
  132.     // Looks for an ARRAYQ pointer whose pathname matches the given one,
  133.     // and returns the Queue Handle of that ARRAYQ.
  134.     //
  135.     BOOL GetQueueHandle(TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  136.                                                      QUEUEHANDLE* phClosedQueueHandle);
  137.     //
  138.     // Prints to screen the pathname of all ARRAYQ's in the PathName array.
  139.     //
  140.     void DisplayOpenedQueuePathNameArray();
  141.  
  142.  
  143.     //
  144.     // functions to manipulate both of the queues.
  145.     //
  146.     
  147.     //
  148.     // Moves an ARRAYQ pointer from the PathName array to the Opened Queue PathName array.
  149.     //
  150.     void MoveToOpenedQueuePathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN],
  151.                                                    QUEUEHANDLE hQueue, DWORD dwAccess);
  152.     //
  153.     // Moves an ARRAYQ pointer from the Opened Queue PathName array array to the PathName.
  154.     //
  155.     void MoveToPathNameArray(TCHAR szPathName[MAX_Q_PATHNAME_LEN]);
  156.     //
  157.     // Looks for ARRAYQ's that are found in both arrays
  158.     // and removes them from the PathName array.
  159.     //
  160.     void UpdatePathNameArrays();
  161.  
  162. };
  163.  
  164. extern "C" void  PrintToScreen(const TCHAR * Format, ...);
  165. extern CWnd* pMainView;
  166.  
  167. /////////////////////////////////////////////////////////////////////////////
  168.