醉了,函数赋值不成功
int CRemotClientDlg::SendCommandPacket(int sCmd, bool bAutoCloose, BYTE* pData, size_t nLength){
UpdateData();
CClientSocket* pClient = CClientSocket::getInstance();
bool ret = pClient->InitSocket(m_serv_addressIP, atoi((LPCSTR)m_port));
if (!ret)
{
AfxMessageBox("网络初始化失败!");
return -1;
}
CPacket pack(sCmd, pData,nLength);
ret = pClient->_Send(pack);
int ncmd = pClient->_Recv();
TRACE("ret:[%d]\n", ncmd);
if (bAutoCloose)
{
pClient->CloseClient();
}
return ncmd; //到这里ncmd依旧是6
}
int ret = SendCommandPacket(wparam >> 1, wparam & 1, NULL, NULL); //ret赋值了个0
醉了,函数返回的时候ncmd一直是6,赋值到ret的时候ret就是不变6,反倒是赋值了个0,这啥情况,大佬帮忙瞅瞅
int ret =CRemotClientDlg::SendCommandPacket(wparam >> 1, wparam & 1, NULL, NULL); //ret赋值了个0
没怎么学过C++,但是我觉得应该把类名加上吧 村里小黑 发表于 2021-11-1 08:54
没怎么学过C++,但是我觉得应该把类名加上吧
不是,手贱了,多打了个int....
页:
[1]