Home > Software engineering >  MFC use SendTo send data with ReceiveFrom the problem of data
MFC use SendTo send data with ReceiveFrom the problem of data

Time:10-08

Cstrings IP, the text; UINT port=GetDlgItemInt (IDC_PORT);
M_sock. SendTo (text, text. GetLength (), the port, IP);

Cstrings IP; UINT port;
Would be s [9999];
Int n=ReceiveFrom (s, 9999-1, IP, port);
If (n<=0)
return;
S [n]='\ 0';
Cstrings STR, readonly;
STR=s;
received data number is right, but only shows half of the characters, how to solve? VS the unicode character set true trouble online to see some of the character set conversion method, also won't work, if to multibyte set a lot of code to change

CodePudding user response:

打开include\tchar.h一眼吧,

CodePudding user response:

Would be s [9999]; Char s [9999];
  • Related