亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? idatasink20.cpp

?? OPC Client 源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// IDataSink20.cpp: implementation of the IDataSink20 class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "IDataSink20.h"
#include "OPCData.h"


#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

class COPCItem;
class COPCGroup;
class COPCServer;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IDataSink20::IDataSink20():m_cnRef (0)
{

}

IDataSink20::~IDataSink20()
{

}

// **************************************************************************
// AddRef ()
//
// Description:
//	This function is called to increment our reference count.  Caller should 
//	increment our reference count each time a new pointer to this interface
//	is created (except when obtained by a call to QueryInterface which will
//  bump the reference count on its behalf). 
//
//	This is one of the 3 member functions all COM interfaces must implement. 
//
// Parameters:
//	none
//
// Returns:
//	STDMETHODIMP_(ULONG) - Reference count resulting from this call.
// **************************************************************************
STDMETHODIMP_(ULONG) IDataSink20::AddRef ()
	{
	// Increment the reference count then return value:
	return (++m_cnRef);
	}

// **************************************************************************
// Release ()
//
// Description:
//	This function is called to decrement our reference count.  Caller should
//	decrement our reference count just before each pointer to this interface 
//	is destroyed (goes out of scope).  Standard COM practice requires us to
//  self-delete once the refernce count returns to zero.
//
//	This is one of the 3 member functions all COM interfaces must implement.
//
// Parameters:
//	none
//
// Returns:
//	STDMETHODIMP_(ULONG) - Reference count resulting from this call.
// **************************************************************************
STDMETHODIMP_(ULONG) IDataSink20::Release ()
	{
	// Decrement reference count and return immediately if not zero:
	if (--m_cnRef != 0)
		return (m_cnRef);

	// If we make it here, then the reference count is zero.  We are 
	// therefore obliged to delete ourselves:
	delete this;

	// Return our refence count, which is zero now:
	return (0);
	}

// **************************************************************************
// QueryInterface ()
//
// Description:
//	This function is called to obtain a pointer to one of the COM interfaces
//	objects of this class support (in this case only IAdviseSink and its base
//	class IUnknown).  As is standard COM practice, our reference count is 
//	incremented upon a successful query.  
//
//  This is one of the 3 member functions all COM interfaces must implement.	
//
// Parameters:
//	REFIID		riid			Requested interface type: IID_IUnknown,
//								  or IID_IAdviseSink.
//	LPVOID		*ppInterface	Pointer to requested interface.
//
// Returns:
//	STDMETHODIMP -
//		S_OK - Query successful, ppInterface set to requested pointer.
//		E_INVALIDARG - One of the arguments was invalid.
//		E_NOINTERFACE - Requested interface is not supported.
// **************************************************************************
STDMETHODIMP IDataSink20::QueryInterface (REFIID iid, LPVOID *ppInterface)
	{
	// Validate ppInterface.  Return with "invalid argument" error code if invalid:
	if (ppInterface == NULL)
		return (E_INVALIDARG);

	// Standard COM practice requires that we invalidate output arguments
	// if an error is encountered.  Let's assume an error for now and invalidate
	// ppInterface.  We will reset it to a valid interface pointer later if we
	// determine requested ID is valid:
	*ppInterface = NULL;	

	// Reset ppInterface if requested interface type is valid:
	if (iid == IID_IUnknown)
		*ppInterface = (IUnknown *) this;
	else if (iid == IID_IOPCDataCallback)
		*ppInterface = (IOPCDataCallback *) this;
	else
		{
		// We have been asked for an interface we don't support.  Return 
		// immediately with "no interface" error code.  ppInterface should
		// still be NULL as required by COM.
		return (E_NOINTERFACE);
		}

	// If we made it here, then the query was successful and ppInterface
	// has been set to requested interface pointer.  Standard COM practice
	// requires us to increment our reference count now.
	AddRef ();

	// Return with "success" code:
	return (S_OK);
	}

// **************************************************************************
// OnDataChange ()
//
// Description:
//	This method is provided to handle notifications from an OPC Group for
//	exception based (unsolicited) data changes and refreshes.  Data for one
//	or possibly more active items in the group will be provided.
//
// Parameters:
//	DWORD		dwTransID			Zero 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.
//
// Returns:
//	STDMETHODIMP - 
//		S_OK - Processing of advisement successful.
//		E_INVALIDARG - One of the arguments was invalid.
// **************************************************************************
// 數(shù)據(jù)更新回調(diào)函數(shù)
// **************************************************************************
STDMETHODIMP IDataSink20::OnDataChange (DWORD dwTransID,
						OPCHANDLE hGroup,
						HRESULT hrMasterQuality,
						HRESULT hrMasterError,
						DWORD dwCount,
						OPCHANDLE *phClientItems,
						VARIANT *pvValues,
						WORD *pwQualities,
						FILETIME *pftTimeStamps,
						HRESULT *pErrors)
	{
	COPCGroup *pGroup = NULL;
	COPCItem *pItem = NULL;

	// Initialize a bad item handle counter (used for debugging only):
	DWORD cdwBadItemHandles = 0;

	// Validate arguments.  Return with "invalid argument" error code 
	// if any are invalid:
	if (hGroup					== NULL	||
		dwCount					== 0	||
		phClientItems			== NULL	||
		pvValues				== NULL	||
		pwQualities				== NULL	||
		pftTimeStamps			== NULL	||
		pErrors					== NULL)
		return (E_INVALIDARG);

	// The group argument gives us a pointer to the destination COPCGroup:
	pGroup = (COPCGroup *) hGroup;

	// Post a "read complete" message for refresh transactions (which will 
	// have a non-zero transaction ID).  No need to load up event log with 
	// "read complete" messages for unsolicited data updates, which could be
	// coming in many times per second.
	if (dwTransID != 0)
		{
//		LogMsg (IDS_ASYNC20_READXACT_COMPLETE, dwTransID, dwCount,
//				pGroup->GetName (), hrMasterError);
		}

	// Loop over items:
	// 讀取項數(shù)據(jù)
	for (DWORD dwItem = 0; dwItem < dwCount; dwItem++)
		{
		// The client item handles give us pointers to the destination
		// COPCItem objects:
		pItem = (COPCItem *) phClientItems [dwItem];

		// Wrap use of pItem in exception handler in case pointer is bad:
		try
			{
			// Update the item's value, quality, and timestamp:
			pItem->UpdateData (pvValues [dwItem], pwQualities [dwItem], pftTimeStamps [dwItem]);
			}
		catch (...)
			{
			// Must have tried to use a bad pItem pointer.  Bump a bad item 
			// handle count and try to process then next item:
			++cdwBadItemHandles;
			continue;
			}

		// Issue a TRACE message if item read resulted in an error. This is 
		// for debugging purposes.  You could call GetErrorString() to get
		// meaning of server specific error codes and log them if you wish.
		if (FAILED (pErrors [dwItem]))
			{
			TRACE (_T("OPC: OnDataChange 2.0 - item '%s' failure %08X\r\n"), 
				pItem->GetItemID (), pErrors [dwItem]);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品亚洲а∨天堂免在线| 天天操天天干天天综合网| 欧美精品三级日韩久久| 欧美性感一区二区三区| 色欧美日韩亚洲| 在线中文字幕不卡| 色狠狠桃花综合| 欧美在线短视频| 欧美猛男超大videosgay| 欧美精选一区二区| 91精品国产综合久久婷婷香蕉| 欧美美女bb生活片| xfplay精品久久| 中文字幕av不卡| 亚洲国产aⅴ天堂久久| 五月天视频一区| 久久99国产精品久久99果冻传媒| 久久精品国产亚洲高清剧情介绍 | 欧美一区二区三区四区视频| 欧美高清你懂得| 久久久综合网站| 亚洲欧美视频在线观看视频| 午夜激情一区二区三区| 久久成人精品无人区| 成人免费视频一区| 欧美日韩1区2区| 精品日韩成人av| 亚洲日本在线视频观看| 三级在线观看一区二区| 国产麻豆精品95视频| 99视频有精品| 日韩亚洲欧美综合| 亚洲天堂成人在线观看| 免费观看成人av| 99vv1com这只有精品| 欧美一级欧美一级在线播放| 中文字幕在线播放不卡一区| 日韩国产在线一| 99精品黄色片免费大全| 日韩精品最新网址| 一区二区三区精品在线| 国产.欧美.日韩| 欧美精品在欧美一区二区少妇| 亚洲国产电影在线观看| 日韩av中文字幕一区二区三区 | 色综合天天做天天爱| 欧美日韩成人综合在线一区二区| 国产三级一区二区三区| 日韩精品电影一区亚洲| 在线影院国内精品| 国产精品成人免费在线| 国模套图日韩精品一区二区| 777色狠狠一区二区三区| 中文字幕在线观看一区二区| 蜜臀精品一区二区三区在线观看 | 国产精品亲子乱子伦xxxx裸| 日韩成人精品在线观看| 99久久久国产精品| 国产午夜精品一区二区三区视频 | 成人免费视频视频在线观看免费| 91精品久久久久久蜜臀| 亚洲高清视频在线| 欧美专区亚洲专区| 亚洲六月丁香色婷婷综合久久| 国v精品久久久网| 国产视频一区在线播放| 成人综合婷婷国产精品久久免费| 久久综合国产精品| 精品夜夜嗨av一区二区三区| 717成人午夜免费福利电影| 亚洲国产人成综合网站| 欧美性受xxxx| 亚洲成人av一区| 欧美日韩国产大片| 天涯成人国产亚洲精品一区av| 91福利国产精品| 日韩精品亚洲专区| 日韩美一区二区三区| 国内精品国产成人国产三级粉色 | 国产69精品一区二区亚洲孕妇| 久久久一区二区三区捆绑**| 国模套图日韩精品一区二区 | 精品理论电影在线| 国产在线精品免费| 国产精品视频观看| 欧日韩精品视频| 日韩av网站在线观看| 久久无码av三级| 91天堂素人约啪| 天天av天天翘天天综合网色鬼国产 | 精品日韩欧美在线| 国产精品18久久久久久久久久久久| 久久综合色婷婷| 成人免费毛片片v| 樱花草国产18久久久久| 欧美精品一级二级三级| 国内精品国产成人国产三级粉色| 国产精品进线69影院| 欧美午夜在线一二页| 久久不见久久见免费视频7| 久久精品一区蜜桃臀影院| 91老师片黄在线观看| 日韩精品一级中文字幕精品视频免费观看 | 亚洲图片欧美色图| 日韩一级高清毛片| 91麻豆国产福利精品| 日韩极品在线观看| 亚洲欧洲日本在线| 国产精品乱码妇女bbbb| 97国产一区二区| 精品一区二区三区在线观看| 中文字幕亚洲不卡| 精品剧情在线观看| 在线看日本不卡| 丰满白嫩尤物一区二区| 蜜臀av性久久久久蜜臀aⅴ| 国产精品色眯眯| 日韩视频免费观看高清完整版| 成人黄色大片在线观看| 肉色丝袜一区二区| 亚洲免费在线电影| 久久综合久久综合久久| 欧美影视一区在线| 国产91精品一区二区| 蜜桃视频一区二区三区在线观看| 国产精品免费网站在线观看| 日韩三级高清在线| 欧美中文字幕亚洲一区二区va在线| 激情综合一区二区三区| 午夜精品aaa| 亚洲午夜在线电影| 亚洲精品免费在线| 中文字幕精品一区二区精品绿巨人 | 亚洲综合小说图片| 中文字幕第一区二区| 久久一二三国产| 欧美一二三四在线| 7777精品伊人久久久大香线蕉超级流畅 | 一区二区三区精密机械公司| 中文在线资源观看网站视频免费不卡 | 成人免费精品视频| 国产精品中文欧美| 久久av中文字幕片| 麻豆国产精品一区二区三区| 日韩成人一级片| 天天综合天天综合色| 亚洲五月六月丁香激情| 夜夜夜精品看看| 亚洲黄一区二区三区| 亚洲另类在线视频| 亚洲精品中文在线观看| 18欧美乱大交hd1984| 亚洲欧美一区二区久久| 亚洲激情第一区| 亚洲一卡二卡三卡四卡五卡| 亚洲国产精品久久人人爱蜜臀 | 琪琪一区二区三区| 蜜桃视频在线观看一区| 经典一区二区三区| 国产盗摄女厕一区二区三区| 国产一区二区三区香蕉| 成人av在线网站| 欧美视频在线一区| 日韩欧美资源站| 欧美极品另类videosde| 亚洲桃色在线一区| 亚洲不卡av一区二区三区| 日韩福利电影在线| 国产精品99精品久久免费| 99re成人在线| 91精品国产欧美一区二区成人| 日韩欧美电影一二三| 国产精品免费久久久久| 亚洲一线二线三线久久久| 蜜桃视频在线一区| 丰满少妇在线播放bd日韩电影| 99re热视频这里只精品| 欧美一级高清大全免费观看| 国产欧美日韩另类一区| 亚洲第一成人在线| 国产成人一级电影| 色噜噜狠狠成人网p站| 欧美成人精品1314www| 中文一区二区完整视频在线观看| 亚洲一区二区视频| 国产伦精品一区二区三区免费迷| av电影在线观看一区| 在线综合亚洲欧美在线视频| 国产亚洲一区二区三区| 亚洲成人你懂的| 国产成人久久精品77777最新版本| 一本色道久久综合亚洲精品按摩| 欧美一级二级三级蜜桃| 亚洲女人小视频在线观看| 韩国成人精品a∨在线观看| 91黄色在线观看| 欧美激情在线免费观看| 免费久久99精品国产| 日本韩国欧美一区二区三区| 久久九九全国免费|