本文介绍了unicode中的Wsarecv问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WSARecv正在ansi工作,但它不能用于unicode





CStringA str(缓冲区);

WSABUF WSABuf [] = {nMaxLen,str.GetBuffer()};





if(!:: WSARecv(m_hSocket, WSABuf,1,& dwBytesRecv,& dwFlags,NULL,NULL))

return(int)dwBytesRecv;



str.ReleaseBuffer ();





Pleaese让我知道可能是什么问题。



我尝试了什么:



WSARecv返回10053错误,但是它在ansi

解决方案中工作方案

WSARecv is working in ansi but its not working in unicode


CStringA str(Buffer);
WSABUF WSABuf[] = { nMaxLen, str.GetBuffer() };


if ( !::WSARecv(m_hSocket, WSABuf, 1, &dwBytesRecv, &dwFlags, NULL, NULL) )
return (int)dwBytesRecv;

str.ReleaseBuffer();


Pleaese let me know what might be the problem.

What I have tried:

WSARecv is returning 10053 error but its working in ansi

解决方案


这篇关于unicode中的Wsarecv问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 12:39