Are you using this example
Instead of pragma you could just add it using Project Properties (in Solution Explorer right click the project name and select properties)->Configuration Properties->Linker->Input and add ws2_32.lib to Additional Dependencies. In VS2010 this is a semicolon seperated list, so at the end, just before %(AdditionalDependencies), add ws2_32.lib; to the list.
THIS IS YOUR CODE
s1 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
a.sin_addr.s_addr = inet_addr("127.0.0.1");
a.sin_family = AF_INET;
a.sin_port = htons(1000);
a doesn't have those methods, the socket does, replace a
with s1
please
The same goes for this:
lLength = connect(s1, (SOCKADDR*)&a, sizeof(a));
just a question
Why are you passing the main window
MainWindow w;
w.show();
iResult = WSAStartup(MAKEWORD(2,2), &w);
to your WSAStartup??
Pass a WSADATA wsaData;