Answer the question
In order to leave comments, you need to log in
GetWindowText() writes to an array of chars through a character, how to solve?
the code:
char msg[256];
GetWindowText(obj.hEDIT,(LPWSTR)&msg, sizeof(msg));
//SendMessage(obj.hEDIT, EM_GETLINE, 0,(LPARAM)(LPSTR)msg);
servermessage(msg);
SendMessage(obj.hListBox, LB_ADDSTRING, 0, (LPARAM)(LPCSTR)msg);
int s = sizeof(msg);
send(hconnect, msg, s, NULL);
return 0;
Answer the question
In order to leave comments, you need to log in
GetWindowText() writes to an array of chars via character
GetWindowText(obj.hEDIT,(LPWSTR)&msg, sizeof(msg));
sizeof(msg)
a sizeof(msg)/sizeof(*LPWSTR)
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question