📄 idatasink20.h
字号:
// IDataSink20.h: interface for the IDataSink20 class.
// 数据回调:
// OPC1.0 IAdviseSink
// OPC2.0 IOPCDataCallback
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_IDATASINK20_H__A31EE385_4EE2_4572_AE9C_481037B9FDA8__INCLUDED_)
#define AFX_IDATASINK20_H__A31EE385_4EE2_4572_AE9C_481037B9FDA8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class IDataSink20 : public IOPCDataCallback //OPC2.0 Interface
{
public:
IDataSink20();
virtual ~IDataSink20();
public:
// IUnknown Methods
STDMETHODIMP QueryInterface (REFIID iid, LPVOID *ppInterface);
STDMETHODIMP_(ULONG) AddRef ();
STDMETHODIMP_(ULONG) Release ();
//*******************************************************************************************************
// IOPCDataCallback Methods
//*******************************************************************************************************
//1. OnDataChange notifications
STDMETHODIMP OnDataChange (
DWORD dwTransID, // 0 for normal OnDataChange events, non-zero for Refreshes
OPCHANDLE hGroup, // client group handle
HRESULT hrMasterQuality, // S_OK if all qualities are GOOD, otherwise S_FALSE
HRESULT hrMasterError, // S_OK if all errors are S_OK, otherwise S_FALSE
DWORD dwCount, // number of items in the lists that follow
OPCHANDLE *phClientItems, // item client handles
VARIANT *pvValues, // item data
WORD *pwQualities, // item qualities
FILETIME *pftTimeStamps, // item timestamps
HRESULT *pErrors); // item errors
//2. OnReadComplete notifications
STDMETHODIMP OnReadComplete (
DWORD dwTransID, // Transaction ID returned by the server when the read was initiated
OPCHANDLE hGroup, // client group handle
HRESULT hrMasterQuality, // S_OK if all qualities are GOOD, otherwise S_FALSE
HRESULT hrMasterError, // S_OK if all errors are S_OK, otherwise S_FALSE
DWORD dwCount, // number of items in the lists that follow
OPCHANDLE *phClientItems, // item client handles
VARIANT *pvValues, // item data
WORD *pwQualities, // item qualities
FILETIME *pftTimeStamps, // item timestamps
HRESULT *pErrors); // item errors
//3. OnWriteComplete notifications
STDMETHODIMP OnWriteComplete (
DWORD dwTransID, // Transaction ID returned by the server when the write was initiated
OPCHANDLE hGroup, // client group handle
HRESULT hrMasterError, // S_OK if all errors are S_OK, otherwise S_FALSE
DWORD dwCount, // number of items in the lists that follow
OPCHANDLE *phClientItems, // item client handles
HRESULT *pErrors); // item errors
//4. OnCancelComplete notifications
STDMETHODIMP OnCancelComplete (
DWORD dwTransID, // Transaction ID provided by the client when the read/write/refresh was initiated
OPCHANDLE hGroup);
private:
DWORD m_cnRef;
};
#endif // !defined(AFX_IDATASINK20_H__A31EE385_4EE2_4572_AE9C_481037B9FDA8__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -