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

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

?? shutdownsink.cpp

?? OPC客戶端源代碼
?? CPP
字號:
// **************************************************************************
// shutdownsink.cpp
//
// Description:
//	Implements our IOPCShutdown class and IOPCShutdown COM interface.  OPC
//	Servers use this interface to advise us that they are shutting down.
//	Upon shuch notifications, we should release all connections and 
//	interfaces to that server.  We must maintain separate callbacks for each
//	OPC Server we are connected to.
//
//	This interface is rquired for OPC version 2.0.
//
// DISCLAIMER:
//	This programming example is provided "AS IS".  As such Kepware, Inc.
//	makes no claims to the worthiness of the code and does not warranty
//	the code to be error free.  It is provided freely and can be used in
//	your own projects.  If you do find this code useful, place a little
//	marketing plug for Kepware in your code.  While we would love to help
//	every one who is trying to write a great OPC client application, the 
//	uniqueness of every project and the limited number of hours in a day 
//	simply prevents us from doing so.  If you really find yourself in a
//	bind, please contact Kepware's technical support.  We will not be able
//	to assist you with server related problems unless you are using KepServer
//	or KepServerEx.
// **************************************************************************


#include "stdafx.h"
#include "opctestclient.h"
#include "shutdownsink.h"
#include "server.h"


// **************************************************************************
// IKShutdownSink ()
//
// Description:
//	Constructor.	Reference count is initialize to zero.
//
// Parameters:
//  CKServer	*pServer	Pointer to CKServer object to associated with
//							  this interface instance.
//
// Returns:
//  none
// **************************************************************************
IKShutdownSink::IKShutdownSink (CKServer *pServer) : m_cnRef (0)
	{
	// Save pointer to server as a member variable.  We will need it in
	// callback function.
	ASSERT (pServer != NULL);
	m_pServer = pServer;
	}

// **************************************************************************
// ~IKShutdownSink ()
//
// Description:
//	Destructor.
//
// Parameters:
//  none
//
// Returns:
//  none
// **************************************************************************
IKShutdownSink::~IKShutdownSink ()
	{
	}

// **************************************************************************
// 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) IKShutdownSink::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) IKShutdownSink::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 IKShutdownSink::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_IOPCShutdown)
		*ppInterface = (IOPCShutdown *) 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);
	}

// **************************************************************************
// ShutdownRequest ()
//
// Description:
//	This method is provided so that the OPC Server can request that we
//	remove all groups from the server and disconnect.
//
// Parameters:
//  LPCWSTR		lpwszReason		Pointer to string describing reason for
//								  shutdown request.  Could be NULL string.
//
// Returns:
//  STDMETHODIMP - S_OK
// **************************************************************************
STDMETHODIMP IKShutdownSink::ShutdownRequest (LPCWSTR lpwszReason)
	{
	// Pass request and reason to associated server object:
#ifdef _UNICODE
	m_pServer->ShutdownRequest (lpwszReason);
#else
	// We need to convert wide character string (Unicode) to multibyte 
	// character string (ANSI) for non-Unicode builds since 
	// CKServer::ShutdownRequest() takes an LPCTSTR.
	TCHAR szReason [DEFBUFFSIZE];
	_wcstombsz (szReason, lpwszReason, sizeof (szReason) / sizeof (TCHAR));

	m_pServer->ShutdownRequest (szReason);
#endif
	return (S_OK);
	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区高清| 亚洲欧美经典视频| 免费在线观看成人| 欧美精品乱码久久久久久| 亚洲一区日韩精品中文字幕| 欧美日韩国产在线观看| 亚洲mv在线观看| 制服丝袜中文字幕亚洲| 久久99久久精品| 国产三级一区二区| 成人的网站免费观看| 亚洲欧洲成人精品av97| 欧美视频在线观看一区二区| 日本麻豆一区二区三区视频| 日韩一二在线观看| 福利电影一区二区| 亚洲久草在线视频| 欧美电影在线免费观看| 黄网站免费久久| 国产精品美女久久久久久| 欧美在线观看你懂的| 日本 国产 欧美色综合| 欧美激情一区不卡| 欧美制服丝袜第一页| 久久99久久久久久久久久久| 国产精品护士白丝一区av| 欧美日韩国产电影| 国产精品资源在线看| 一区二区久久久久久| 欧美刺激脚交jootjob| 99re这里只有精品6| 日韩av中文字幕一区二区| 久久精品综合网| 在线观看91精品国产入口| 久久99久久精品| 亚洲午夜视频在线观看| 久久久www成人免费无遮挡大片| 色中色一区二区| 狠狠色丁香九九婷婷综合五月| 亚洲日本免费电影| 久久久久久久久久久久久久久99 | 欧美精品一区二区三区四区 | 视频一区二区中文字幕| 日本一区二区三区免费乱视频 | 裸体健美xxxx欧美裸体表演| 最新高清无码专区| 日韩欧美亚洲一区二区| 91免费观看视频| 国产精选一区二区三区| 亚洲第一福利一区| 亚洲同性gay激情无套| 26uuu亚洲婷婷狠狠天堂| 欧美在线综合视频| 色综合天天综合网天天看片| 国产麻豆视频一区二区| 日本视频免费一区| 一区二区免费视频| 中文字幕亚洲不卡| 欧美激情在线一区二区| 欧美xxx久久| 欧美一卡2卡三卡4卡5免费| 在线免费不卡电影| www.亚洲精品| av福利精品导航| 成人网在线播放| 国产大陆亚洲精品国产| 久久国产日韩欧美精品| 日韩精品电影在线观看| 亚洲成人一区二区| 亚洲最大色网站| 一区二区三区蜜桃| 亚洲丝袜另类动漫二区| 综合久久一区二区三区| 国产精品乱人伦| 亚洲国产精品v| 国产清纯在线一区二区www| 久久精品人人做人人爽人人| 久久久久久一二三区| 精品国产三级电影在线观看| 日韩欧美123| 国产午夜精品理论片a级大结局| www国产精品av| 久久一区二区三区国产精品| xfplay精品久久| 久久久噜噜噜久久中文字幕色伊伊| 久久久蜜桃精品| 国产精品家庭影院| 亚洲乱码日产精品bd| 一区二区三区在线观看网站| 亚洲国产精品嫩草影院| 午夜伦欧美伦电影理论片| 婷婷开心久久网| 久久99精品国产麻豆婷婷| 国产一区二区精品久久| 国产99久久久国产精品免费看| 丁香桃色午夜亚洲一区二区三区| 成人教育av在线| 在线亚洲人成电影网站色www| 欧美色精品在线视频| 欧美一级高清片| 久久精品亚洲一区二区三区浴池 | 午夜精品免费在线观看| 日韩精品一区第一页| 激情成人午夜视频| 成人国产视频在线观看| 欧美中文字幕亚洲一区二区va在线| 91精品国产品国语在线不卡| 亚洲精品一线二线三线| 国产精品超碰97尤物18| 亚洲国产精品久久久男人的天堂| 青青草原综合久久大伊人精品 | 国产1区2区3区精品美女| 色综合久久久网| 91麻豆精品国产91久久久使用方法| 精品第一国产综合精品aⅴ| 中文字幕一区二区三中文字幕| 亚洲午夜久久久久久久久电影院| 美女视频免费一区| 99国产精品一区| 欧美一区中文字幕| 国产精品不卡在线| 久久成人麻豆午夜电影| 99久久er热在这里只有精品66| 欧美欧美午夜aⅴ在线观看| www国产成人免费观看视频 深夜成人网| 国产精品成人免费在线| 裸体一区二区三区| 色8久久精品久久久久久蜜| 久久蜜桃一区二区| 亚洲与欧洲av电影| 国产91精品一区二区麻豆网站| 欧美色手机在线观看| 亚洲国产精华液网站w| 奇米色一区二区| 91片黄在线观看| 国产亚洲福利社区一区| 天天综合日日夜夜精品| av电影天堂一区二区在线 | 狠狠色伊人亚洲综合成人| 日本电影欧美片| 国产日韩欧美激情| 日韩二区在线观看| 在线观看网站黄不卡| 欧美国产禁国产网站cc| 久久99国产精品尤物| 欧美日韩亚洲综合在线 | 色屁屁一区二区| 国产欧美精品一区| 麻豆精品视频在线观看视频| 欧美午夜精品免费| 亚洲特黄一级片| 国产高清成人在线| 久久女同精品一区二区| 日韩国产高清影视| 欧美日韩中文字幕精品| 亚洲精品第1页| 菠萝蜜视频在线观看一区| 精品欧美乱码久久久久久1区2区 | 人禽交欧美网站| 51精品国自产在线| 亚洲成国产人片在线观看| 色婷婷av一区二区三区之一色屋| 国产日产欧美精品一区二区三区| 久久精品99国产精品日本| 欧美久久久久久久久中文字幕| 亚洲美女屁股眼交| 色88888久久久久久影院按摩 | 国产精品白丝jk黑袜喷水| 久久综合九色综合欧美亚洲| 国产一区91精品张津瑜| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 色婷婷激情综合| 国产欧美中文在线| 午夜伦理一区二区| 蜜臂av日日欢夜夜爽一区| 蜜桃av一区二区| 亚洲成a天堂v人片| 亚洲五码中文字幕| 国产精品免费观看视频| 日本成人超碰在线观看| av高清不卡在线| 91精品国产麻豆| 欧美成人aa大片| 91久久免费观看| 97久久超碰国产精品电影| 亚洲福中文字幕伊人影院| 2020国产精品久久精品美国| 91丨九色丨蝌蚪丨老版| 日本在线不卡一区| 国产精品国产三级国产普通话99| 91精品国产手机| 欧美精品在线观看播放| 欧美日韩美女一区二区| 欧美精品亚洲二区| 在线观看视频一区二区| 亚洲人成7777| 国产精品一色哟哟哟| 国产99久久久国产精品免费看 | 亚洲成人一二三| 亚洲精品第一国产综合野|