123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef __MSGDEF_H__
- #define __MSGDEF_H__
- #include "define.h"
- typedef struct _Message
- {
- int nNetCommand; // 网络命令
- unsigned long ulDataLen; // 数据长度
- void* pData; // 数据
- _Message()
- {
- nNetCommand = 0;
- ulDataLen = 0;
- pData = NULL;
- }
- ~_Message()
- {
- SafeRelease(pData);
- }
- }MESSAGE, *LPMESSAGE;
- typedef void (*EVENTHANDLE)(IN CONST int nEventID, IN LPMESSAGE pMsg, IN LPVOID pContext);
- typedef struct _SEvent
- {
- int nEventID; // 暂时没用
- LPMESSAGE pMsg; // 网络消息
- EVENTHANDLE eventHandle; // 事件处理
- LPVOID pContext;
- _SEvent()
- {
- nEventID = 0;
- memset(&pMsg, 0, sizeof(LPMESSAGE));
- pContext = NULL;
- }
- ~_SEvent()
- {
- SafeRelease(pMsg);
- }
- }SEVENT, *LPSEVENT;
- #endif //#ifndef __MSGDEF_H__
|