mycngp2client.h

来自「SMAL是short message abstract library的缩写,是」· C头文件 代码 · 共 100 行

H
100
字号
/**
*	MyCNGP2Client.h
*	
*	CNGP2 API Demo Application.
*
*	Copyright 2003-2006	北京风起水流软件工作室
*	
*	http://www.zealware.com
*	
*	princetoad@gmail.com
*
*/

#include "CNGP2APIDemo.h"
#include "CNGP2APIDemoDlg.h"

/** 包含必要的头文件和库文件
*/
#include <cngp2/cngpconn.h>

#if defined(_MSC_VER)
  #if _MSC_VER >= 1400  ///< vc8(2005)
    #ifdef _DEBUG
      #pragma comment(lib, "smalsd_vc8_md")
    #else
      #pragma comment(lib, "smals_vc8_md")
    #endif
  #elif _MSC_VER >= 1300 ///< VC7(2003)
    #ifdef _DEBUG
      #pragma comment(lib, "smalsd_vc71_md")
    #else
      #pragma comment(lib, "smals_vc71_md")
    #endif
  #else ///< VC6
    #ifdef _DEBUG
      #pragma comment(lib, "smalsd_vc6_md")
    #else
      #pragma comment(lib, "smals_vc6_md")
    #endif
  #endif
#endif

class MyCNGPClient : public CNGPClient
{
public:
	MyCNGPClient(CCNGP2APIDemoDlg & _dlg);

	virtual ~MyCNGPClient();

	/**断开,退出时调用
	*/
	void Release();

	/**打印出连接的统计信息
	*/
	void DumpStatus(CNGPConnection & connection);

	/**@name 重写的虚函数,执行自定义操作
	*/
	//@{
	BOOL OnConnectionSubmiting(
		CNGPConnection & connection,
		cngp_submit _message
		);

	void OnConnectionSubmited(
		CNGPConnection & connection, 
		cngp_submit _message
		);

	void OnConnectionSubmitFailed(
		CNGPConnection & connection, 
		cngp_submit _message 
		);

	void OnReceivedConnectionSubmitResponse(
		CNGPConnection & connection, 
		cngp_submit_deliver_resp _message
		);

	void OnReceivedConnectionDeliver(
		CNGPConnection & connection, 
		cngp_deliver _message
		);

	void OnReceivedConnectionStatusReport(
		CNGPConnection & connection, 
		cngp_deliver _message
		);

	void OnConnectionCleared(CNGPConnection & connection);

	void OnLogWrite(const char * fmt, ...);

	void OnNoAvailableConnection( cngp_submit & _message );

protected:
	CCNGP2APIDemoDlg & dlg;
	//@}
};

⌨️ 快捷键说明

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