⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slikserverevents.h

📁 一个OPC 服务器程序
💻 H
字号:
// SLIKServerEvents.h: interface for the CSLIKServerEvents class.
//
// This class utilizes ATL's support for creating event handlers.
// One need only provide handlers for the events of interest.  This
// is demonstrated below.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SLIKSERVEREVENTS_H__045AE134_3721_4431_AC29_AC6F20398D50__INCLUDED_)
#define AFX_SLIKSERVEREVENTS_H__045AE134_3721_4431_AC29_AC6F20398D50__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


//
//	The following statement will create NDISLIKDA2.tlh and NDISLIKDA2.tli files
//	in the output directory.  See MSDN for more details.
//
//	NOTE:	The location of the SLIK-DA DLL MAY be different on your machine!
//			Please modify if so.
//
#import "C:\Program Files\Common Files\Northern Dynamic\SLIK-DA2\NDISLIKDA2.dll" \
	no_namespace named_guids


#define SOURCE_ID	1000

class CSLIKServerEvents : 
   public IDispEventImpl<
		SOURCE_ID,					// Not really used here - extraneous info
		CSLIKServerEvents,			// This class
		&DIID__ISLIKServerEvents,	// SLIK-DA events dispinterface
		&LIBID_NDISLIKDA,			// SLIK-DA type library id
		2,							// SLIK-DA type library major version Number
		0							// SLIK-DA type library minor version Number
	   >
   {
public:
	CSLIKServerEvents();
	virtual ~CSLIKServerEvents();

	//
	//	We'll only provide a minimal set of event handlers.  
	//	SLIK-DA can automaically handle everything else for us.
	//
	BEGIN_SINK_MAP(CSLIKServerEvents)
		SINK_ENTRY_EX( SOURCE_ID, DIID__ISLIKServerEvents, 1, OnClientConnectHandler )
		SINK_ENTRY_EX( SOURCE_ID, DIID__ISLIKServerEvents, 2, OnClientDisconnectHandler )
		SINK_ENTRY_EX( SOURCE_ID, DIID__ISLIKServerEvents, 9, OnReadHandler )
		SINK_ENTRY_EX( SOURCE_ID, DIID__ISLIKServerEvents, 10, OnWriteHandler )
	END_SINK_MAP()

	// Event handler for OnClientConnect event, defined in idl as
	// [id(1)] HRESULT OnClientConnect(
    //					[in] long NumClients, 
    //					[in, out] VARIANT_BOOL* AcceptConnection);
    HRESULT __stdcall OnClientConnectHandler(
        long			lNumClients,
        VARIANT_BOOL	*pbAcceptConnection 
		);

	// Event handler for OnClientDisconnect event, defined in idl as
	// [id(2)] HRESULT OnClientDisconnect(
    //					[in] long NumClients); 
    HRESULT __stdcall OnClientDisconnectHandler(
        long			lNumClients
		);

	// Event handler for OnRead event, defined in idl as
	// [id(9)] HRESULT OnRead(
	//					[in] long Count, 
	//					[in] SAFEARRAY(ISLIKTag*)* Tags, 
	//					[in] SAFEARRAY(BSTR)* AccessPaths, 
	//					[in, out] SAFEARRAY(long)* Errors, 
	//					[in, out] long* Result);
	HRESULT __stdcall OnReadHandler(
		long		lCount, 
		SAFEARRAY	**ppsaTags, 
		SAFEARRAY	**ppsaAccessPaths, 
		SAFEARRAY	**ppsaErrors, 
		long		*plResult
		);

	// Event handler for OnWrite event, defined in idl as
	// [id(0xa)] HRESULT OnWrite(
	//					[in] long Count, 
	//					[in] SAFEARRAY(ISLIKTag*)* Tags, 
	//					[in] SAFEARRAY(BSTR)* AccessPaths, 
	//					[in] SAFEARRAY(VARIANT)* Values, 
	//					[in, out] SAFEARRAY(long)* Errors, 
	//					[in, out] long* Result);
	HRESULT __stdcall OnWriteHandler(
		long		lCount, 
		SAFEARRAY	**ppsaTags, 
		SAFEARRAY	**ppsaAccessPaths, 
		SAFEARRAY	**ppsaValues,
		SAFEARRAY	**ppsaErrors, 
		long		*plResult
		);
  
};

#endif // !defined(AFX_SLIKSERVEREVENTS_H__045AE134_3721_4431_AC29_AC6F20398D50__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -