Click here to Skip to main content
16,017,167 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Bug in my BMP-routine... thanks, Paolo Pin
Christoph Rupp1-Jul-00 22:51
sussChristoph Rupp1-Jul-00 22:51 
GeneralImage library (Re: Bug in my BMP-routine... thanks, Paolo) Pin
Uwe Keim2-Jul-00 21:30
sitebuilderUwe Keim2-Jul-00 21:30 
GeneralInterface Pin
Member 375684729-Jun-00 9:04
Member 375684729-Jun-00 9:04 
GeneralCEdit vs CStatic Pin
Paul Galla29-Jun-00 6:37
sussPaul Galla29-Jun-00 6:37 
GeneralRe: CEdit vs CStatic Pin
Mike Dunn29-Jun-00 7:48
Mike Dunn29-Jun-00 7:48 
GeneralResuming FTP / HTTP downloads... Pin
xtsea29-Jun-00 4:25
xtsea29-Jun-00 4:25 
QuestionHow to check a socket is disconnected Pin
Stefan29-Jun-00 3:23
Stefan29-Jun-00 3:23 
AnswerRe: How to check a socket is disconnected Pin
Yaron29-Jun-00 3:43
Yaron29-Jun-00 3:43 
hi,

i really need help in windows sockets, here is a function i wrote to connect to server:

//----------- Function Implementation --------------------------------
bool ConnectToSocket()
{
if (WSAVERNOTSUPPORTED == WSAStartup(MAKEWORD(2,0),&WSAData))
{
printf("WSAStartup Failed!\r\n");
return FALSE;
}//end if
else
{
printf("WSAStartup Success\r\n");
}//end else

// construct socket
sock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if (sock == INVALID_SOCKET)
{
printf("Failed to construct socket!\r\n");
WSACleanup();
return FALSE;
}//end if
else
{
printf("Socket construction....Success\r\n");
}//end else

// fill in socket address struct and connect to server
sa.sin_family = AF_INET;
sa.sin_port = 23;
sa.sin_addr.S_un.S_addr = inet_addr("147.234.12.233");

int iErr = connect( sock,(SOCKADDR *)&sa,sizeof(sa));


return TRUE;
}

it doesn't seem to work ,i dont know why..... also how do i receive and send data????

please help me i am desperate!

tnx a lot
yaron
GeneralRe: How to check a socket is disconnected Pin
RamiBuchnik29-Jun-00 4:31
RamiBuchnik29-Jun-00 4:31 
QuestionDebug Assertion Failed ? Pin
kasjhdfkjhfj29-Jun-00 3:12
kasjhdfkjhfj29-Jun-00 3:12 
AnswerRe: Debug Assertion Failed ? Pin
Christoph Rupp29-Jun-00 11:03
sussChristoph Rupp29-Jun-00 11:03 
GeneralRe: Debug Assertion Failed ? Thanks Chris Pin
kasjhdfkjhfj30-Jun-00 3:41
kasjhdfkjhfj30-Jun-00 3:41 
GeneralMessage handler Pin
Bjorn29-Jun-00 1:44
Bjorn29-Jun-00 1:44 
GeneralRe: Message handler Pin
Mike Dunn29-Jun-00 7:33
Mike Dunn29-Jun-00 7:33 
GeneralFTP's LIST command's reply format Pin
Trieu Nguyen29-Jun-00 1:06
Trieu Nguyen29-Jun-00 1:06 
GeneralRe: FTP's LIST command's reply format Pin
Jeff Naber21-Jul-00 13:18
Jeff Naber21-Jul-00 13:18 
QuestionHow to add horizontal scrollbar to dropdown list Pin
Chris Vischer29-Jun-00 0:09
Chris Vischer29-Jun-00 0:09 
AnswerRe: How to add horizontal scrollbar to dropdown list Pin
Paolo Messina30-Jun-00 13:43
professionalPaolo Messina30-Jun-00 13:43 
GeneralSetup Q: How to install a DSN Pin
Matthias29-Jun-00 0:08
Matthias29-Jun-00 0:08 
GeneralRe: Setup Q: How to install a DSN Pin
Yaron29-Jun-00 3:45
Yaron29-Jun-00 3:45 
GeneralCFileDialog Pin
Tenacious28-Jun-00 22:47
Tenacious28-Jun-00 22:47 
GeneralRe: CFileDialog Pin
cmulcay28-Jun-00 23:18
cmulcay28-Jun-00 23:18 
Questionhow to set the font used for button/label Pin
mactan28-Jun-00 22:28
sussmactan28-Jun-00 22:28 
AnswerRe: how to set the font used for button/label Pin
Mike Dunn29-Jun-00 0:38
Mike Dunn29-Jun-00 0:38 
Questionhow to set the font used for button/label Pin
mactan28-Jun-00 22:28
sussmactan28-Jun-00 22:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.