home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Win32_Samples / win32 / sysinfo / sysinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  3.0 KB  |  105 lines

  1. //+----------------------------------------------------------------------------
  2. // 
  3. // File:        app.h
  4. //
  5. // Copyight:    (c) 1997, Microsoft Corporation
  6. //                 All Rights Reserved
  7. //                Infomation Contained Herein Is Propprietary and Confidential
  8. //
  9. // Contents:     simple app defines, prototypes & external data 
  10. //                declarations
  11. //
  12. //-----------------------------------------------------------------------------
  13.  
  14. #ifndef CSYSINFO_H
  15. #define CSYSINFO_H
  16.  
  17. // Global functions
  18. BOOL    LoadBSTR(UINT, BSTR*, HINSTANCE);
  19.  
  20. class CSysInfoSink : public IASEventSink, IASClassMsgSink
  21. {
  22.     public:
  23.         CSysInfoSink();
  24.         ~CSysInfoSink() {}
  25.  
  26.  
  27.         // IUnknown Members
  28.         STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);    //Returns a point to requested interface
  29.         STDMETHODIMP_(ULONG) AddRef(void);                        //Adds to the reference count
  30.         STDMETHODIMP_(ULONG) Release(void);                        //Reduces reference count and deletes object if needed
  31.  
  32.         // IASEventSink
  33.         STDMETHODIMP ReceiveMsg(long uMsg, long wParam, long lParam);
  34.  
  35.         // IASClassMsgSink
  36.         STDMETHODIMP HandleClose(IDispatch *pdispControl) 
  37.         { return S_FALSE; }
  38.         STDMETHODIMP HandleDraw(IDispatch *pdispControl, OLE_HANDLE hDC) 
  39.         { return S_FALSE; }
  40.         STDMETHODIMP HandleGotFocus(IDispatch *pdispControl) 
  41.         { return S_FALSE; }
  42.         STDMETHODIMP HandleLostFocus(IDispatch *pdispControl) 
  43.         { return S_FALSE; }
  44.         STDMETHODIMP HandleStart(IDispatch *pdispControl) 
  45.         { return S_FALSE; }
  46.         STDMETHODIMP HandleMessage(IDispatch *pdispControl, long uMsg, long wParam, long lParam)
  47.         { return S_FALSE; }
  48.         // HandleKeyPress is the only method we implement
  49.         STDMETHODIMP HandleKeyPress(IDispatch *pdispControl, long lKeyDown);
  50.  
  51.         //IDispatch methods, a token implementation required for COM
  52.         STDMETHODIMP GetTypeInfoCount(UINT *pctInfo) 
  53.         { return E_NOTIMPL; }                                                    
  54.         STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo) 
  55.         { return E_NOTIMPL; }                                                    
  56.         STDMETHODIMP GetIDsOfNames(REFIID riid,    OLECHAR **rgszNames, UINT cNames, 
  57.             LCID lcid, DISPID *rgdispids) 
  58.         { return E_NOTIMPL; }                                                    
  59.         STDMETHODIMP Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams,            
  60.             VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr) 
  61.         { return E_NOTIMPL; }                                                    
  62.  
  63.  
  64.     private:
  65.         long        m_cRef;
  66.  
  67.  
  68. };
  69.  
  70. class CSysInfoApp
  71. {
  72.     public:
  73.         CSysInfoApp(HINSTANCE);
  74.         ~CSysInfoApp();
  75.  
  76.  
  77. // Attributes
  78.     public:
  79.         BSTR                m_bstrAppName;          // Application caption title.
  80.  
  81.     public:
  82.         IASEventSink*        m_pAppEventSink;    // the form and app's event sink
  83.         IASClassMsgSink*    m_pAppMessageSink;
  84.         IfmManage*            m_pManage;          // the forms manager object
  85.         IASForm*            m_pForm;
  86.         IASPowerListBox*    m_pPLBInfo;
  87.  
  88.         HINSTANCE            m_hInst;
  89.  
  90.         DWORD                m_dwThreadId;
  91.  
  92. // Operations
  93.     public:
  94.         BOOL    Init();
  95.  
  96.     private:
  97.         HRESULT CreateSink();
  98.         HRESULT CreateForm();
  99.         HRESULT CreateFormManager();
  100.         HRESULT BuildMenu();
  101. };
  102.  
  103. #endif //CSYSINFO_H    
  104.  
  105.