Click to See Complete Forum and Search --> : inside ATLCOM


muthiah_c
May 12th, 2003, 09:45 AM
hi

this is the function i have i n c++.
AcceptConnections(SOCKET sock);

but i want to add this method to ATL Object.
There i am getting error saying that
error MIDL2025 : syntax error : expecting a type specification near "SOCKET"

that file is .idl file.

please help me in this.
basically i want to pass a structure to interface method.

bye
seshu

rxbagain
May 12th, 2003, 06:15 PM
error MIDL2025 : syntax error : expecting a type specification near "SOCKET"
This means that the MIDL compiler cannot recognize "SOCKET". Actually when you look at the declaration of SOCKET in WINSOCK.H, it is declared this way

typedef unsigned int u_int;
typedef u_int SOCKET;

So in this way, SOCKET is just a C 32 bit unsigned int. So you will do is just change your declaration to long

AcceptConnections(long sock);

Hope it will help you