发表于:2002-08-21 19:44:00
楼主
在实际中由于在NvMonitorPoint的UpdateEvent的事件中响应的是所有的nv事件,
考虑可能对于节点太多的情况就是用多线程也未必能达到即时,
所以想采用ILcaNvMonitorPointListener的UpdateEvent事件来触发。
我在编程资料中看到如下内容。
To create an object which receives network variable UpdateEvent updates, follow these steps:
1.Create an object which implements the ILcaNvMonitorPointListener interface.
2.Define the object"s behavior when the UpdateEvent method is called.
3.Call a NvMonitorPoint object"s Advise with the object created in step 1 as an argument.
The object will now call this method whenever a network variable monitor point update is
receivedmonitor point update is received.
但是ILcaNvMonitorPointListener的定义是
ILcaNvMonitorPointListener : public IUnknown
{
public:
virtual /* [helpcontext] */ HRESULT __stdcall UpdateEvent(
/* [in] */ ILcaDataPoint __RPC_FAR *DataPoint,
/* [in] */ ILcaSourceAddress __RPC_FAR *SrcAddr) = 0;
virtual /* [helpcontext] */ HRESULT __stdcall UpdateErrorEvent(
/* [in] */ short UpdateType) = 0;
};
这样的话如何实现ILcaNvMonitorPointListener接口呢?紧接着下面也很难实现。不知道可以不可以指导一下。