Koolski
May 20th, 2004, 05:16 PM
Hi,
I'm new to sockets and I read the other posts and took your advice and have gotten "Network Programing for Microsoft Windows" and am trying to work up a prototype for the project I'm currently working on based on concepts in the book. The particular problem I'm having is hopefully a simple problem that I'm just having a brain cramp on. When I try to compile (Visual Studio 2003) the following two lines (verbatim from the book)
GUID guidAcceptEx = WSAID_ACCEPTEX;
GUID guidGetAcceptExSockaddrs = WSAID_GETACCEPTEXSOCKADDRS;
I get the following errors:
error C2059: syntax error : '{'
error C2143: syntax error : missing ';' before '{'
error C2059: syntax error : '{'
error C2059: syntax error : '}'
error C2143: syntax error : missing ';' before '}'
error C2059: syntax error : '}'
error C2143: syntax error : missing ';' before '{'
error C2447: '{' : missing function header (old-style formal list?)
The compiler doesn't like the expansion of the #define of these, but I don't know how to get around this. Any suggestions? This is for my call to load the Winsock extension functions; the call is below.
rc = WSAIoctl(
pListenobj->Sock,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&guidAcceptEx,sizeof(guidAcceptEx),
&pListenobj->lpfnAcceptEx,
sizeof(pListenobj->lpfnAcceptEx),
&Bytes,NULL,NULL);
I'm new to sockets and I read the other posts and took your advice and have gotten "Network Programing for Microsoft Windows" and am trying to work up a prototype for the project I'm currently working on based on concepts in the book. The particular problem I'm having is hopefully a simple problem that I'm just having a brain cramp on. When I try to compile (Visual Studio 2003) the following two lines (verbatim from the book)
GUID guidAcceptEx = WSAID_ACCEPTEX;
GUID guidGetAcceptExSockaddrs = WSAID_GETACCEPTEXSOCKADDRS;
I get the following errors:
error C2059: syntax error : '{'
error C2143: syntax error : missing ';' before '{'
error C2059: syntax error : '{'
error C2059: syntax error : '}'
error C2143: syntax error : missing ';' before '}'
error C2059: syntax error : '}'
error C2143: syntax error : missing ';' before '{'
error C2447: '{' : missing function header (old-style formal list?)
The compiler doesn't like the expansion of the #define of these, but I don't know how to get around this. Any suggestions? This is for my call to load the Winsock extension functions; the call is below.
rc = WSAIoctl(
pListenobj->Sock,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&guidAcceptEx,sizeof(guidAcceptEx),
&pListenobj->lpfnAcceptEx,
sizeof(pListenobj->lpfnAcceptEx),
&Bytes,NULL,NULL);