📄 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 + -