📄 ipersistfile.cpp
字号:
/////////////////////////////////////////////////////////////////////////////
//
// OPC Data Access VC++ Client: IPersistFile.CPP
// (Source File)
//
/////////////////////////////////////////////////////////////////////////////
//
// Author: Raphael Imhof
// Initial Date: 11/04/98
// $Workfile: IPersistFile.cpp $
// $Revision: 1 $
// $Date: 7/27/99 5:23p $
// Target System: Microsoft Windows NT 4.0
// Environment: Visual C++ 5.0 / OPC DataAccess 1.0/2.0
// Remarks:
//
/////////////////////////////////////////////////////////////////////////////
//
// Description: implementation of the CIPersistFile class.
// IPersistFile wrapper.
//
//
/////////////////////////////////////////////////////////////////////////////
//
// History of Changes (Please remove very old comments and blank lines!)
// $Log: /IDK/OPCServer/clients/VC++/InfoServerExplorer/IPersistFile.cpp $
//
// 1 7/27/99 5:23p Imhof
//
// 1 7/27/99 5:19p Imhof
//
// 4 1/15/99 6:43p Imhof
// Updated legal notice.
//
// 3 11/25/98 3:00p Betrisey
// Added menu item <OPC> <Print Statistic to log file>
// All the InfoServer statistic counters are printed out to the log file.
// Note that we do "misuse" the IPersist::Save() API to do that. This API
// returns "not implemented".
//
// 2 11/10/98 2:20p Imhof
// Added file header's.
//
// $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 "infoserverexplorer.h"
#include "IPersistFile.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CIPersistFile::CIPersistFile(CComPtr<IUnknown> pUnknown)
{
if(FAILED(pUnknown->QueryInterface(IID_IPersistFile, (void**)&m_pPersistFile)))
{
m_pPersistFile = NULL;
TRACE("CIPersistFile() \n");
}
}
CIPersistFile::CIPersistFile(CComPtr<IPersistFile> pPersistFile)
{
m_pPersistFile = pPersistFile;
}
CIPersistFile::~CIPersistFile()
{
}
HRESULT CIPersistFile::Load(LPCOLESTR pszFileName, DWORD dwMode)
{
if(m_pPersistFile == NULL)
return E_FAIL;
HRESULT res = m_pPersistFile->Load(pszFileName, dwMode);
if(FAILED(res))
{
TRACE(_T("CIPersistFile::Load"));
}
return res;
}
HRESULT CIPersistFile::Save( LPCOLESTR pszFileName, BOOL fRemember)
{
if(m_pPersistFile == NULL)
return E_FAIL;
HRESULT res = m_pPersistFile->Save(pszFileName, fRemember);
if(FAILED(res))
{
TRACE(_T("CIPersistFile::Save"));
}
return res;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -