www.pudn.com > OPC_VC++.rar > OPCSample_cppDlg.h


// OPCSample_cppDlg.h : header file 
// 
 
#if !defined(AFX_OPCSAMPLE_CPPDLG_H__BA928979_8E00_11D3_A1E7_004005319944__INCLUDED_) 
#define AFX_OPCSAMPLE_CPPDLG_H__BA928979_8E00_11D3_A1E7_004005319944__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#define OPC_SYNC    1 
#define OPC_ASYNC   2 
 
class COPCSample_cppApp; 
 
class Item : public CObject 
{ 
public: 
  Item(){ 
    name.Empty(); 
    quality=0; 
    value.Clear(); 
    dwLastError=0; 
    boActual=FALSE; 
  } 
  CString       name; 
  CString       cAccessPath; 
  COleVariant   value; 
  WORD          quality; 
  DWORD         dwLastError; 
  BOOL          boActual; 
}; 
 
class CAdviseSink : public IAdviseSink 
{ 
public: 
   CAdviseSink(); 
   ~CAdviseSink(void); 
 
   STDMETHODIMP QueryInterface(REFIID, void**); 
   STDMETHODIMP_(ULONG) AddRef(void); 
   STDMETHODIMP_(ULONG) Release(void); 
 
   STDMETHODIMP_(void)  OnDataChange(LPFORMATETC, LPSTGMEDIUM); 
   STDMETHODIMP_(void)  OnViewChange(DWORD, LONG); 
   STDMETHODIMP_(void)  OnRename(LPMONIKER); 
   STDMETHODIMP_(void)  OnSave(void); 
   STDMETHODIMP_(void)  OnClose(void); 
 
protected: 
   ULONG               m_cRef; 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
// COPCSample_cppDlg dialog 
 
class COPCSample_cppDlg : public CDialog 
{ 
// Construction 
public: 
	COPCSample_cppDlg(COPCSample_cppApp *p, CWnd* pParent = NULL);	// standard constructor 
 
// Dialog Data 
	//{{AFX_DATA(COPCSample_cppDlg) 
	enum { IDD = IDD_OPCSAMPLE_CPP_DIALOG }; 
	CTreeCtrl	m_Tree; 
	CListCtrl	m_List; 
	//}}AFX_DATA 
 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(COPCSample_cppDlg) 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
	HICON m_hIcon; 
 
	// Generated message map functions 
	//{{AFX_MSG(COPCSample_cppDlg) 
	virtual BOOL OnInitDialog(); 
	afx_msg void OnPaint(); 
	afx_msg HCURSOR OnQueryDragIcon(); 
	afx_msg void OnSelchangedTree(NMHDR* pNMHDR, LRESULT* pResult); 
	afx_msg void OnTimer(UINT nIDEvent); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
private: 
  void InitializeTree(); 
  void InsertChildren( LPWSTR child, HTREEITEM hParent ); 
  HRESULT BrowseHere( HTREEITEM item ); 
  COPCSample_cppApp             *pcApp; 
  IOPCBrowseServerAddressSpace  *pcBrowse; 
  IOPCItemMgt                   *pcItemMgt; 
  DWORD                         *pdwServerHandles; 
}; 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_OPCSAMPLE_CPPDLG_H__BA928979_8E00_11D3_A1E7_004005319944__INCLUDED_)