📄 iopcitemmgt.cpp
字号:
/////////////////////////////////////////////////////////////////////////////
//
// OPC Trend VC++ Client: IOPCItemMgt.CPP
// (Source File)
//
/////////////////////////////////////////////////////////////////////////////
//
// Author: Raphael Imhof
// Initial Date: 11/04/98
// $Workfile: IOPCItemMgt.cpp $
// $Revision: 1 $
// $Date: 7/27/99 5:24p $
// Target System: Microsoft Windows NT 4.0
// Environment: Visual C++ 5.0 / OPC DataAccess 1.0 / 2.0
// Remarks:
//
/////////////////////////////////////////////////////////////////////////////
//
// Description: implementation of the CIOPCItemMgt class.
// IOPCItemMgt wrapper.
//
//
/////////////////////////////////////////////////////////////////////////////
//
// History of Changes (Please remove very old comments and blank lines!)
// $Log: /IDK/OPCServer/clients/VC++/Trend/IOPCItemMgt.cpp $
//
// 1 7/27/99 5:24p Imhof
//
// 1 7/27/99 5:19p Imhof
//
// 4 1/15/99 7:04p Imhof
// Updated legal notice.
//
// 3 12/15/98 10:30a Imhof
// Modifications for OPC 2.0
//
// 2 11/06/98 5:53p Imhof
// Added header, comment and made some small code changes.
//
//
// $Nokeywords:$ (To avoid useless search while checking in.)
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998, Siemens Building Technologies, Inc. Landis Division
//
// SIEMENS BUILDING TECHNOLOGIES, INC. IS PROVIDING THE FOLLOWING
// EXAMPLES OF CODE AS SAMPLE ONLY.
//
// SIEMENS BUILDING TECHNOLOGIES, INC. MAKES NO REPRESENTATIONS
// OR WARRANTIES OF ANY KIND WITH RESPECT TO THE VALIDTY OF THE
// CODES OR DESIRED RESULTS AND DISCLAIMS ALL SUCH
// REPRESENTATIONS AND WARRANTIES, INCLUDING FOR EXAMPLE,
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE. SIEMENS BUILIDNG TECHNOLOGIES, INC. DOES NOT
// REPRESENT OR WARRANT THAT THE FOLLOWING CODE SAMPLES ARE
// ACCURATE, VALID, COMPLETE OR CURRENT.
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "IOPCItemMgt.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CIOPCItemMgt::CIOPCItemMgt(CComPtr<IOPCItemMgt> pOPCItemMgt)
{
m_pOPCItemMgt = pOPCItemMgt;
}
CIOPCItemMgt::CIOPCItemMgt(CComPtr<IOPCGroupStateMgt> pOPCGroup)
{
if(FAILED(pOPCGroup->QueryInterface(IID_IOPCItemMgt, (void**)&m_pOPCItemMgt)))
{
m_pOPCItemMgt = NULL;
TRACE("CIOPCItemMgt() \n");
}
}
CIOPCItemMgt::~CIOPCItemMgt()
{
}
HRESULT CIOPCItemMgt::AddItems( DWORD dwNumItems,
OPCITEMDEF* pItemArray,
OPCITEMRESULT** ppAddResults,
HRESULT** ppErrors )
{
if(m_pOPCItemMgt == NULL)
return E_FAIL;
HRESULT hr = m_pOPCItemMgt->AddItems(dwNumItems, pItemArray, ppAddResults, ppErrors);
if( FAILED( hr ) )
TRACE(_T("IOPCItemMgt::AddItems"));
return hr;
}
HRESULT CIOPCItemMgt::RemoveItems( DWORD dwNumItems,
OPCHANDLE* phServer,
HRESULT** ppErrors )
{
if(m_pOPCItemMgt == NULL)
return E_FAIL;
HRESULT hr = m_pOPCItemMgt->RemoveItems(dwNumItems, phServer, ppErrors);
if( FAILED( hr ) )
TRACE(_T("IOPCItemMgt::RemoveItems"));
return hr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -