?? seriessample.cpp
字號:
// SeriesSample.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "SeriesSample.h"
#include "SeriesSampleDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//===== ADD Globile variable=======
//define for NETWORK LAYER PACKET constant
//Status of Send_object
#define ST_SENDOBJ_DISABLE 0
#define ST_SENDOBJ_ACTIVE 1
#define ST_SENDING_OBJ 2
#define ST_SENDOBJ_FINISHED 3
// 信息頭
#define PAA 0xAA // 包起始第一位
#define P55 0x55 // 包起始第二位
// 包類型
#define PT_SEARCHNWREQ 0xA0 //搜索網絡請求
#define PT_SEARCHNWACK 0xA1 //搜索網絡應答
#define PT_SEARCHNDREQ 0xA2 //搜索設備請求
#define PT_SEARCHNDACK 0xA3 //搜索設備應答
#define PT_CONNREQ 0xA4 // 握手請求包
#define PT_CONNACK 0xA5 // 握手應答包
#define PT_SENDMSGREQ 0xB0 //消息發送
#define PT_SENDMSGACK 0xB1 //消息發送應答
#define PT_BROADCAST 0xB2 //消息廣播
#define PT_BROADCASTACK 0xB3 //消息廣播應答
#define PT_OBJTRANSREQ 0xC0 //對象傳輸請求
#define PT_OBJTRANSACK 0xC1 //對象傳輸應答
#define PT_ZBQULITYREQ 0xF0 //ZB信號質量查詢請求
#define PT_ZBQULITYRACK 0xF1 //ZB信號質量查詢應答
#define PT_ZBSENSITIVEREQ 0xF2 //ZB信號靈敏度查詢請求
#define PT_ZBSENSITIVEACK 0xF3 //ZB信號靈敏度查詢應答
#define MAX_PACKET_LEN 114 //最大包長度
#define MAX_PACKET_DATA_LEN 100 //最大包數長度
#define MAX_BUF_LEN 4096 ////最大緩沖區長度
CString g_MyID,g_OtherID,g_MyNickName,g_MyPwd,g_OtherNickName,
g_OtherGender,g_MyShow,g_OtherShow,g_RecvStr,g_MyFileName;
int g_MyIcon,g_OtherIcon,g_MyGender,g_PacketNo,g_FileLength;
BYTE g_second,g_statusOfObj,g_recvLen,g_BS_NoG,g_dataPointer;
BYTE g_BS_State[99];
BYTE g_sendBuf[MAX_PACKET_LEN];
BYTE g_recvBuf[MAX_BUF_LEN];
BYTE g_recvdata[MAX_PACKET_LEN];
WORD g_WritePointer,g_ReadPointer;
HANDLE g_hMyFileHandle;
BOOL g_bCom_Open,g_bRecvAck,g_bPacketRecv_Flag,g_bDone,g_bGhExit,g_bLargePacket;
//====== end Add Globile variable====
/////////////////////////////////////////////////////////////////////////////
// CSeriesSampleApp
BEGIN_MESSAGE_MAP(CSeriesSampleApp, CWinApp)
//{{AFX_MSG_MAP(CSeriesSampleApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSeriesSampleApp construction
CSeriesSampleApp::CSeriesSampleApp()
: CWinApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CSeriesSampleApp object
CSeriesSampleApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CSeriesSampleApp initialization
BOOL CSeriesSampleApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
CSeriesSampleDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -