資源簡介
KEPWare的OPC通訊示例C++版,可以直接編譯運(yùn)行

代碼片段和文件信息
//?**************************************************************************
//?advisesink.cpp
//
//?Description:
// Implements?the?CKAdviseSink?class?and?IAdviseSink?COM?interface.??Groups
// in?OPC?Servers?can?use?the?IAdviseSink?interface?to?advise?us?of?data
//??change?events.
//
// OPC?1.0?requires?that?only?the?OnDataChange?member?function?of?the?
// IAdviseSink?interface?be?implemented.?None?of?the?others?(OnClose?
// OnSave?etc.)?should?ever?get?called.
//
// The?IAdviseSink?interface?is?used?by?OPC?version?1.0.??OPC?version?2.0
// uses?the?IOPCDataCallback?interface?instead.??If?you?know?that?your?
//??server(s)?will?only?be?using?OPC?version?2.0?you?don‘t?really?need?this.
//
//?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?“advisesink.h“
#include?“item.h“
#include?“group.h“
//?**************************************************************************
//?CKAdviseSink?()
//
//?Description:
// Constructor.??Reference?count?is?initialized?to?zero.
//
//?Parameters:
// none
//
//?Returns:
// none
//?**************************************************************************
CKAdviseSink::CKAdviseSink?()?:?m_cRef?(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.
//?**************************************************************************
STDM
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????23420??2007-02-13?11:04??Visual?C++?OPC?Client?Example\advisesink.cpp
?????文件???????1852??2007-02-13?11:04??Visual?C++?OPC?Client?Example\advisesink.h
?????文件??????17809??2007-02-13?11:04??Visual?C++?OPC?Client?Example\datasink20.cpp
?????文件???????3455??2007-02-13?11:04??Visual?C++?OPC?Client?Example\datasink20.h
?????文件??????36339??2007-02-13?11:04??Visual?C++?OPC?Client?Example\document.cpp
?????文件???????4604??2007-02-13?11:04??Visual?C++?OPC?Client?Example\document.h
?????文件??????14218??2007-02-13?11:04??Visual?C++?OPC?Client?Example\editfilters.cpp
?????文件???????3956??2007-02-13?11:04??Visual?C++?OPC?Client?Example\editfilters.h
?????文件??????25098??2007-02-13?11:04??Visual?C++?OPC?Client?Example\eventview.cpp
?????文件???????4091??2007-02-13?11:04??Visual?C++?OPC?Client?Example\eventview.h
?????文件???????2731??2007-02-13?11:04??Visual?C++?OPC?Client?Example\fixedsharedfile.h
?????文件???????8305??2007-02-13?11:04??Visual?C++?OPC?Client?Example\globals.cpp
?????文件???????4681??2007-02-13?11:04??Visual?C++?OPC?Client?Example\globals.h
?????文件?????119956??2007-02-13?11:04??Visual?C++?OPC?Client?Example\group.cpp
?????文件???????7772??2007-02-13?11:04??Visual?C++?OPC?Client?Example\group.h
?????文件??????24208??2007-02-13?11:04??Visual?C++?OPC?Client?Example\grouppropertysheet.cpp
?????文件???????4655??2007-02-13?11:04??Visual?C++?OPC?Client?Example\grouppropertysheet.h
?????文件??????53462??2007-02-13?11:04??Visual?C++?OPC?Client?Example\groupview.cpp
?????文件???????3465??2007-02-13?11:04??Visual?C++?OPC?Client?Example\groupview.h
?????文件???????4429??2007-02-13?11:04??Visual?C++?OPC?Client?Example\imagebutton.cpp
?????文件???????1699??2007-02-13?11:04??Visual?C++?OPC?Client?Example\imagebutton.h
?????文件??????25014??2007-02-13?11:04??Visual?C++?OPC?Client?Example\item.cpp
?????文件???????4302??2007-02-13?11:04??Visual?C++?OPC?Client?Example\item.h
?????文件??????65972??2007-02-13?11:04??Visual?C++?OPC?Client?Example\itemadddlg.cpp
?????文件???????4810??2007-02-13?11:04??Visual?C++?OPC?Client?Example\itemadddlg.h
?????文件??????32624??2007-02-13?11:04??Visual?C++?OPC?Client?Example\itempropertiesdlg.cpp
?????文件???????2901??2007-02-13?11:04??Visual?C++?OPC?Client?Example\itempropertiesdlg.h
?????文件??????81825??2007-02-13?11:04??Visual?C++?OPC?Client?Example\itemview.cpp
?????文件???????4663??2007-02-13?11:04??Visual?C++?OPC?Client?Example\itemview.h
?????文件??????16104??2007-02-13?11:04??Visual?C++?OPC?Client?Example\itemwritedlg.cpp
............此處省略181個(gè)文件信息
評(píng)論
共有 條評(píng)論