Featured Replies
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Используя этот сайт, вы соглашаетесь Условия использования.
there were various other errors with it , i solved most of them and when i finished WTF too many errors came UP , help me out with this
Program Source
// d4rkl1ght.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "d4rkl1ght.h" #include #define NETWORK_ERROR -1 #define NETWORK_OK 0 int _stdcall WinMain(HINSTANCE hlinstance,HINSTANCE hPrevlinstance,LPSTR IpCmdLine,int nShowCmd) //Creating an Instance { MessageBox(0,L"\t v1.0.1 \nStarting Whois Lookup... \n Devloped And Maintained By |LuD KiLlEr|",L"d4rk l1ght",0); WSADATA ws; int nret; //intialize Winsock WSAStartup(0x0101,&ws); //create socket SOCKET comm; comm=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); if(comm==INVALID_SOCKET) { MessageBox(0,L"Failed to Create A Socket",L"Error!",0); WSACleanup(); return NETWORK_ERROR; } SOCKADDR_IN serverinfo; serverinfo.sin_family=AF_INET; /*Whois IP whois.networksolutions.com */ serverinfo.sin_addr.s_addr=inet_addr("205.178.188.12"); serverinfo.sin_port=htons(43); nret=connect(comm,(LPSOCKADDR)&serverinfo,sizeof(struct sockaddr)); if(nret==SOCKET_ERROR) { MessageBox(0,L"Failed TO Connect TO Server",L"Error!!",0); WSACleanup(); return NETWORK_ERROR; } char sbuffer[256]="fourdeltaone.net\r\n"; char rbuffer[5000]; nret=send(comm,sbuffer,strlen(sbuffer),0); if(nret==SOCKET_ERROR) { MessageBox(0,L"Could not Send Request TO Server ",L"Error!",0); WSACleanup(); return NETWORK_ERROR; } nret=recv(comm,rbuffer,sizeof(rbuffer),0); if(nret!=SOCKET_ERROR) MessageBox(0,(LPCWSTR)rbuffer,L"Whois Look Up Success",0); //typecast char to LPCWSTR ...it doesnt accept char shows error find an alternate closesocket(comm); WSACleanup(); return NETWORK_OK; }i am new to Visual C++ .....
know C++ so started with Sockets .
EDITi tried linking winsock.h but it shows
cannot open file 'winsock.h'
EDIT 2 : Solved that one too :? but now it shows some unwanted result ??