Well, I am not positive it has to do with the WinSock, but that is what I am guessing. I am getting an error message when I run my application. It does compile, but I get this message when I click the 'Send' Button.
Here is a link to a printscreen of the message:
http://s873.photobucket.com/user/retsgorf297/media/failure_zpsda359fca.jpg.html
Here is some of the code that I think is causing this problem:
Command for "Send" Button:
1 2 3 4 5 6 7 8
|
case SEND:
CHAR buffer[1024];
INT test = sizeof(buffer);
ZeroMemory(&buffer, sizeof(buffer));
SendMessage(outEdit, WM_GETTEXT, sizeof(test), reinterpret_cast<LPARAM>(buffer));
send(Socket, buffer, strlen(buffer), 0);
SendMessage(outEdit, WM_SETTEXT, 0, (LPARAM) "");
break;
|
FD_READ:
1 2 3 4 5 6 7 8 9 10 11 12
|
switch (WSAGETSELECTEVENT(lParam))
{
case FD_READ:
{
CHAR incoming[1024];
ZeroMemory(&incoming, sizeof(incoming));
INT dataLength = recv(Socket, incoming, strlen(incoming), 0);
strncat_s(HISTORY, incoming, dataLength);
strcat_s(HISTORY, "\n");
SendMessage(inEdit, WM_SETTEXT, sizeof(incoming) - 1, reinterpret_cast<LPARAM>(HISTORY));
}
break;
|
Also, HISTORY is defined like this:
CHAR HISTORY[10240];
That was some of the code in my server code (where I think the problem is). The reason I think it is here is that after the message in the link, I get a break point in my server application.
Please tell me if you need to see more code.
Thank you!