?? netagent.cpp
字號:
// netAgent.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "netAgent.h"
#include "envInit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
if(argc<2)
{
printf("錯誤的啟動參數,exit");
return 99;
}
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
printf("初始化MFC錯誤,exit");
return 21;
}
if(!AfxSocketInit())
{
printf("初始化SOCKET錯誤,exit");
return 22;
}
SetAgentName(argv[1]);
GlobalOpenUniqueProcess(GetAgentName());
InitScreenLayout();
InitConsoleAndEnv(".\\LOG\\",GetAgentName());
InitIniInfo(GetAgentName());
if(!CreateListenThread())
{
printf("Create Listen Thread錯誤,exit");
return 23;
}
WaitForSingleObject(GetListenThreadHandle(),INFINITE);
//退出前清理環境
ClearConsoleAndEnv();
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -