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

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

?? impiopcitemmgt.cpp

?? 基于Intellution開發(fā)包的開發(fā)的OPC服務(wù)器
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
//			-	S_FALSE if the function was partially successful.
//				This can happen if the client passes down some
//				"good" handles and some "bad" handles to be
//				removed. The client will then need to look in
//				the ppErrors array to find out which item
//				handles caused the errors.
//			-	E_FAIL if the function failed altogether.
//
////////////////////////////////////////////////////////////////
STDMETHODIMP CImpIOPCItemMgt::RemoveItems(DWORD			dwNumItems, 
										  OPCHANDLE		*phServer,
										  HRESULT		**ppErrors)
{
	unsigned int	i;
	OPCHANDLE		OPCHandle;
	HRESULT			*pHResultList, 
					hr = S_OK;


	// Make sure we were passed good pointers
	//
	if((NULL == phServer) ||
	   (NULL == ppErrors))
	{
		return E_INVALIDARG;
	}

	// First - allocate memory for the result array(s)
	//
	*ppErrors = pHResultList = 
		(HRESULT *)pIMalloc->Alloc(sizeof(HRESULT) * dwNumItems);
	if(NULL == pHResultList)
	{
		return E_OUTOFMEMORY;
	}

	// Lock the group so other threads don't try and access the items
	// we are deleting
	//
	m_pParentGroup->Lock();

	// Now for each item handle... 
	//
	for(i = 0; i < dwNumItems; i++)
	{
		// Insure handle is valid
		//
		OPCHandle = phServer[i];
		if(!m_pParentGroup->IsItemValid(OPCHandle))
		{
			pHResultList[i] = OPC_E_INVALIDHANDLE;
			hr = S_FALSE;
			continue;
		}

		// Remove it from the map. (This will perform a Release().)
		//
		m_pParentGroup->ItemFree(OPCHandle);

		pHResultList[i] = S_OK;
	}

	m_pParentGroup->UnLock();
	return hr;
}


////////////////////////////////////////////////////////////////
// SetActiveState()
//
// This function sets the state of a list of functions to either
// active or inactive.
//
// Returns:
//	HRESULT	-	S_OK if everything was successful
//			-	S_FALSE if the function was partially successful.
//				This can happen if the client passes down some
//				"good" handles and some "bad" handles to be
//				removed. The client will then need to look in
//				the ppErrors array to find out which item
//				handles caused the errors.
//			-	E_FAIL if the function failed altogether.
//
////////////////////////////////////////////////////////////////
STDMETHODIMP CImpIOPCItemMgt::SetActiveState(DWORD			dwNumItems, 
											 OPCHANDLE		*phServer, 
											 BOOL			bActive, 
											 HRESULT		**ppErrors)
{
	unsigned int	i;
	OPCHANDLE		OPCHandle;
	HRESULT			*pHResultList,
					hr = S_OK;


	// Make sure we were passed good pointers
	//
	if((NULL == phServer) ||
	   (NULL == ppErrors))
	{
		return E_INVALIDARG;
	}

	// First - allocate memory for the result array(s)
	//
	*ppErrors = pHResultList = (HRESULT*) pIMalloc->Alloc(sizeof(HRESULT) *dwNumItems);
	if(NULL == pHResultList)
	{
		return E_OUTOFMEMORY;
	}

	// Now for each item handle... 
	//
	for(i = 0; i < dwNumItems; i++)
	{
		// Insure handle is valid
		//
		OPCHandle = phServer[i];
		if(FALSE == m_pParentGroup->IsItemValid(OPCHandle))
		{
			pHResultList[i] = OPC_E_INVALIDHANDLE;
			hr = S_FALSE;
			continue;
		}

		// And if so then activate the item
		//
		m_pParentGroup->GetItemPtr(OPCHandle)->SetActive(bActive);

		pHResultList[i] = S_OK;
	}

	return hr;
}


////////////////////////////////////////////////////////////////
// SetClientHandles()
//
// This function sets the client handles for a list of items.
// The client handle is the handle that the client uses to
// refer to the item. It really doesn;t have any meaning to us.
//
// Returns:
//	HRESULT	-	S_OK if everything was successful
//			-	S_FALSE if the function was partially successful.
//				This can happen if the client passes down some
//				"good" handles and some "bad" handles to be
//				removed. The client will then need to look in
//				the ppErrors array to find out which item
//				handles caused the errors.
//			-	E_FAIL if the function failed altogether.
//
////////////////////////////////////////////////////////////////
STDMETHODIMP CImpIOPCItemMgt::SetClientHandles(DWORD		dwNumItems, 
											   OPCHANDLE	*phServer,
											   OPCHANDLE	*phClient, 
											   HRESULT		**ppErrors)
{
	unsigned int	i;
	OPCHANDLE		OPCHandle;
	HRESULT			*pHResultList,
					hr = S_OK;


	// Make sure we were passed good pointers
	//
	if((NULL == phServer) ||
	   (NULL == ppErrors) ||
	   (NULL == phClient))
	{
		return E_INVALIDARG;
	}

	// First - allocate memory for the result array(s)
	//
	*ppErrors = pHResultList = (HRESULT*) pIMalloc->Alloc(sizeof(HRESULT) * dwNumItems);
	if(NULL == pHResultList)
	{
		return E_FAIL;
	}

	// Now for each item handle... 
	//
	for(i = 0; i < dwNumItems; i++)
	{
		// Insure handle is valid
		//
		OPCHandle = phServer[i];
		if(!m_pParentGroup->IsItemValid(OPCHandle))
		{
			pHResultList[i] = OPC_E_INVALIDHANDLE;
			hr = S_FALSE;
			continue;
		}

		// And if so then set client handle
		//
		m_pParentGroup->GetItemPtr(OPCHandle)->SetHandle(phClient[i]);

		pHResultList[i] = S_OK;
	}

	return hr;
}


////////////////////////////////////////////////////////////////
// SetDataTypes()
//
// This function sets the requested datatypes of a list of items.
//
// Returns:
//	HRESULT	-	S_OK if everything was successful
//			-	S_FALSE if the function was partially successful.
//				This can happen if the client passes down some
//				"good" handles and some "bad" handles to be
//				removed. The client will then need to look in
//				the ppErrors array to find out which item
//				handles caused the errors.
//			-	E_FAIL if the function failed altogether.
//
////////////////////////////////////////////////////////////////
STDMETHODIMP CImpIOPCItemMgt::SetDatatypes(DWORD		dwNumItems, 
										   OPCHANDLE	*phServer,
										   VARTYPE		*pRequestedDatatypes,
										   HRESULT		**ppErrors)
{
	COPCDrvItem		*pItem			= NULL;
	OPCHANDLE		OPCHandle;
	HRESULT			*pHResultList,
					hr = S_OK;


	// Make sure we were passed good pointers
	//
	if((NULL == phServer) ||
	   (NULL == ppErrors) ||
	   (NULL == pRequestedDatatypes))
	{
		return E_INVALIDARG;
	}

	// First - allocate memory for the result array(s)
	//
	*ppErrors = pHResultList = 
		(HRESULT *)pIMalloc->Alloc(sizeof(HRESULT) * dwNumItems);
	if(NULL == pHResultList)
	{
		return E_FAIL;
	}

	// Now for each item handle... 
	//
	for(DWORD i = 0; i < dwNumItems; i++)
	{
		// Insure handle is valid
		//
		OPCHandle = phServer[i];
		pItem = m_pParentGroup->GetItemPtr(OPCHandle);
		if(FALSE == pItem)
		{
			pHResultList[i] = OPC_E_INVALIDHANDLE;
			hr = S_FALSE;
			continue;
		}

		// And if so then set data type
		//
		pHResultList[i] = pItem->SetDatatype(pRequestedDatatypes[i]);
		if(FAILED(pHResultList[i]))
		{
			hr = S_FALSE;
			continue;
		}
	}

	return hr;
}

 
////////////////////////////////////////////////////////////////
// CreateEnumerator()
//
////////////////////////////////////////////////////////////////
STDMETHODIMP CImpIOPCItemMgt::CreateEnumerator(REFIID		riid, 
											   LPUNKNOWN	*ppUnk)
{
	// Make sure we were passed good pointers
	//
	if(NULL == ppUnk)
	{
		return E_INVALIDARG;
	}

	// default in case of error
	//
	*ppUnk = NULL;


	if (IID_IEnumOPCItemAttributes == riid)
	{
		CImpIEnumOPCItemAttributes	*temp;
		OPCITEMATTRIBUTES			*AttrList;
		int							ItemCount;
		HRESULT						hr;

		// Lock the parent group
		//
		m_pParentGroup->Lock();

		// Get a 'local' snapshot of the item list 
		//
		m_pParentGroup->GetItemList(&AttrList, &ItemCount);

		// Create the Enumerator which will contain a copy of the snapshot
		// Note that the enumerator is not affected by 
		// subsequent changes to the item list.
		// The group will get an 'addref' via m_Parent below and will thus
		// stay around until the enumerator is released 
		// (although this is probably unnecessary)
		//
		temp = new CImpIEnumOPCItemAttributes(m_pUnkOuter, 
											  ItemCount, 
											  AttrList, 
											  pIMalloc);
		m_pParentGroup->FreeItemList(AttrList, ItemCount);

		// Unock the parent group
		//
		m_pParentGroup->UnLock();

		// Then QI for the interface. ('temp' actually is the interface
		// but QI is the 'proper' way to get it.)
		// Note QI will do an AddRef of the Enum which will also do
		// an AddRef of the 'parent' - i.e. the 'this' pointer passed above.
		//
		hr = temp->QueryInterface(riid, (LPVOID *)ppUnk);
		if (FAILED(hr))
		{
			delete temp;
			return hr;
		}

		return S_OK;
	}

	return E_INVALIDARG;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
曰韩精品一区二区| 亚洲国产一区二区三区青草影视| 色综合久久天天| 欧美aa在线视频| 亚洲婷婷综合色高清在线| 日韩一二在线观看| av成人动漫在线观看| 日本在线观看不卡视频| 亚洲欧美日韩久久精品| 日韩欧美精品在线| 精品视频色一区| jlzzjlzz欧美大全| 国产麻豆一精品一av一免费| 日日嗨av一区二区三区四区| 亚洲色图一区二区三区| 久久综合久久99| 日韩视频永久免费| 日本乱人伦一区| 成人激情免费视频| 国产麻豆精品视频| 久久国产日韩欧美精品| 午夜精品福利在线| 亚洲一区二区高清| 亚洲另类中文字| 国产日本欧美一区二区| 欧美电影免费观看完整版| 欧美精品乱码久久久久久| 色呦呦国产精品| 91一区二区在线| 成人美女视频在线看| 国产一区二区三区视频在线播放| 另类小说图片综合网| 日韩精品免费视频人成| 婷婷国产在线综合| 亚洲国产视频一区二区| 一级女性全黄久久生活片免费| 国产精品美女一区二区在线观看| 国产欧美日韩精品在线| 久久精品视频在线看| 久久久久久久久久美女| 久久久一区二区三区| 国产亚洲视频系列| 国产日产精品1区| 国产精品乱人伦| 国产精品久久国产精麻豆99网站| 国产精品人妖ts系列视频| 中文乱码免费一区二区| **性色生活片久久毛片| 亚洲伦在线观看| 亚洲午夜免费电影| 日韩极品在线观看| 久久精品av麻豆的观看方式| 久久99热这里只有精品| 国产丶欧美丶日本不卡视频| 成人天堂资源www在线| 成人av第一页| 欧美亚一区二区| 日韩欧美国产综合在线一区二区三区| 欧美一级理论片| www国产成人| 国产精品午夜免费| 亚洲一级二级在线| 蜜臀av一区二区三区| 国产精品系列在线播放| 不卡的av电影| 欧美肥妇free| 久久日一线二线三线suv| 国产精品久久久久久久久免费桃花 | 欧美精品在线观看一区二区| 欧美一级二级三级蜜桃| 久久精品欧美日韩| 亚洲一区二区三区在线| 老司机精品视频导航| k8久久久一区二区三区 | 另类小说视频一区二区| 国产91丝袜在线播放九色| 91亚洲男人天堂| 欧美电影影音先锋| 国产性色一区二区| 午夜天堂影视香蕉久久| 国产精品一区二区在线播放 | 黑人巨大精品欧美一区| 成人a级免费电影| 精品视频一区二区三区免费| 精品国产一区久久| 亚洲女同女同女同女同女同69| 日韩高清中文字幕一区| 国产寡妇亲子伦一区二区| 色菇凉天天综合网| 久久久久国产精品麻豆| 亚洲一区二区欧美| 福利91精品一区二区三区| 欧美日韩精品一区二区三区蜜桃| 久久久国产一区二区三区四区小说| 一区二区三区四区在线| 国产在线视频一区二区三区| 欧美午夜电影在线播放| 久久久精品国产99久久精品芒果| 亚洲国产裸拍裸体视频在线观看乱了| 精品一区二区三区在线观看 | 337p亚洲精品色噜噜噜| 中文字幕一区三区| 国模无码大尺度一区二区三区| 一本久道中文字幕精品亚洲嫩 | 日本一区二区在线不卡| 日本中文字幕一区二区有限公司| 91丨九色丨尤物| 337p粉嫩大胆色噜噜噜噜亚洲| 一区二区三区高清| 成人av网址在线| 欧美精品一区二区三区蜜桃视频| 亚洲福利电影网| 一本大道久久精品懂色aⅴ| 久久日一线二线三线suv| 午夜免费欧美电影| 欧美这里有精品| 亚洲欧美怡红院| 成人激情免费网站| 久久精品人人做人人综合| 日本不卡不码高清免费观看| 欧美视频三区在线播放| 依依成人精品视频| av在线免费不卡| 欧美国产精品一区| 国产91对白在线观看九色| 精品国产乱码久久久久久闺蜜 | 亚洲视频在线观看三级| 成人国产免费视频| 国产视频在线观看一区二区三区 | 欧美日本一区二区在线观看| 亚洲区小说区图片区qvod| 国产传媒欧美日韩成人| 26uuu精品一区二区在线观看| 久久国产剧场电影| 精品欧美一区二区久久| 久草热8精品视频在线观看| 日韩欧美国产综合一区 | 久久精品国产秦先生| 欧美一级一区二区| 久久国内精品自在自线400部| 欧美一区二区啪啪| 蜜桃av一区二区三区| 欧美电视剧免费全集观看| 精品一区二区免费看| 久久久久久久久免费| 国产98色在线|日韩| 最新热久久免费视频| 色呦呦国产精品| 亚洲第四色夜色| 欧美一区二区日韩| 激情综合色丁香一区二区| 亚洲精品在线网站| 成人免费电影视频| 有码一区二区三区| 91麻豆精品国产91久久久更新时间| 男人操女人的视频在线观看欧美| 精品国偷自产国产一区| 国产九色精品成人porny| 国产精品污网站| 色女孩综合影院| 亚洲成va人在线观看| 欧美大肚乱孕交hd孕妇| 国产传媒日韩欧美成人| 亚洲精品成a人| 777色狠狠一区二区三区| 韩国精品久久久| 亚洲男人的天堂网| 4438x成人网最大色成网站| 国产一区二区免费看| 国产精品久99| 91精品国产入口| 国产精品一区二区三区网站| 亚洲男人都懂的| 日韩三级在线观看| av不卡免费电影| 蜜桃视频在线观看一区| 日本一区二区三区高清不卡| 欧美性猛片xxxx免费看久爱| 激情综合网最新| 亚洲综合小说图片| 久久众筹精品私拍模特| 91久久精品国产91性色tv| 美女视频网站久久| 亚洲日本青草视频在线怡红院| 欧美精品亚洲一区二区在线播放| 国产麻豆午夜三级精品| 一区二区三区免费看视频| 久久久不卡影院| 欧美伦理视频网站| 97se亚洲国产综合自在线不卡| 免费人成精品欧美精品| 亚洲摸摸操操av| 久久日韩精品一区二区五区| 欧美体内she精高潮| 高潮精品一区videoshd| 日本欧美大码aⅴ在线播放| 亚洲另类中文字| 中文在线资源观看网站视频免费不卡| 欧美精品久久99| 色婷婷久久综合|