client/Client/DlgLogin.cpp
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// DlgLogin.cpp : 实现文件
//
#include "stdafx.h"
#include "Client.h"
#include "DlgLogin.h"
#include "afxdialogex.h"
#include "openssl/md5.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// DlgLogin 对话框
IMPLEMENT_DYNAMIC(DlgLogin, CDialogEx)
DlgLogin::DlgLogin(CWnd* pParent /*=NULL*/)
: CDialogEx(DlgLogin::IDD, pParent)
, m_TcpConnection()
, m_dispatcher(std::bind(&DlgLogin::handleUnknownMessage, this, std::placeholders::_1))
, m_codec(std::bind(&SyncProtobufDispatcher::HandleSyncMessage, &m_dispatcher, std::placeholders::_1))
, m_userName(_T(""))
, m_password(_T(""))
, m_pWndParent(NULL)
, m_strLoginAddress("")
, m_nPortLogin(0)
, m_strMsgAddress("")
, m_nPortMsg(0)
, m_strEncrytoSeed("")
{
// Verify that the version of the library that we linked against is
// compatible with the version of the headers we compiled against.
GOOGLE_PROTOBUF_VERIFY_VERSION;
m_pWndParent = pParent;
m_strLoginAddress = "127.0.0.1";
m_nPortLogin = 8080;
//注册消息处理函数
m_dispatcher.registerMessageCallback(IM::MsgServResponse::descriptor()
, std::bind(&DlgLogin::handleMsgServerResponse, this, std::placeholders::_1));
m_dispatcher.registerMessageCallback(IM::LoginResponse::descriptor()
, std::bind(&DlgLogin::handleLoginResponse, this, std::placeholders::_1));
//注册网络连接消息回调函数
m_TcpConnection.setMessageCallback(std::bind(&SyncProtobufCodec::onSyncMessage, &m_codec, std::placeholders::_1));
//网络连接服务器
m_TcpConnection.Connect(m_strLoginAddress, m_nPortLogin);
}
DlgLogin::~DlgLogin()
{
}
void DlgLogin::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_UserName, m_userName);
后面还有 143 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
