Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Disable ASSERTS Pin
l a u r e n13-Jan-04 18:32
l a u r e n13-Jan-04 18:32 
GeneralRe: Disable ASSERTS Pin
Prakash Nadar13-Jan-04 22:55
Prakash Nadar13-Jan-04 22:55 
GeneralRe: Disable ASSERTS Pin
misha_grewal13-Jan-04 23:13
misha_grewal13-Jan-04 23:13 
GeneralNext Dll Question ;) Pin
bryce13-Jan-04 15:33
bryce13-Jan-04 15:33 
GeneralRe: Next Dll Question ;) Pin
bryce13-Jan-04 17:45
bryce13-Jan-04 17:45 
GeneralRe: Next Dll Question ;) Pin
Buddhike de Silva13-Jan-04 18:32
Buddhike de Silva13-Jan-04 18:32 
Question"Unhandled exception in Test.ex[MSCTF.DLL]:0XC0000005:Access Violation"??? Pin
zhaopzhi13-Jan-04 15:17
zhaopzhi13-Jan-04 15:17 
Questionhow can i send/receive packets to POP3/IMAP server Pin
chirag_chauhan13-Jan-04 15:06
chirag_chauhan13-Jan-04 15:06 
hi,
i just get frustrated about the problem,
i m trying to connect with the Server using Winsock
and then successfully able to send the packet usinf send() function but will not be able to receive the packet from server using recv() function.
just look at my code snippet.......

WSADATA wsaData;
long Error;
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != NO_ERROR)
printf("Error at WSAStartup()\n");
// Create a SOCKET for connecting to server
SOCKET ConnectSocket;
ConnectSocket = socket(AF_INET, SOCK_STREAM, 0);
if (ConnectSocket == INVALID_SOCKET)
{
printf("Error at socket(): %ld\n", WSAGetLastError());
WSACleanup();
return;
}
// The sockaddr_in structure specifies the address family,
// IP address, and port of the server to be connected to.
char* localIP;
hostent* localHost;
int portNumber = 443;
localHost = gethostbyname("hostname");
localIP = inet_ntoa (*(struct in_addr *)*localHost->h_addr_list);
sockaddr_in clientService;
clientService.sin_family = AF_INET;
clientService.sin_addr.s_addr = inet_addr(localIP);
clientService.sin_port = htons(portNumber);

// Connect to server.
if ( connect(ConnectSocket,(SOCKADDR*)&clientService,sizeof(clientService)) == SOCKET_ERROR)
{
printf( "Failed to connect.\n" );
Error = WSAGetLastError();
printf("\n %ld \n",Error);
WSACleanup();
return;
}

// strcpy(sendbuf,"a400\ws.asp");
bytesSent = send(ConnectSocket,sendbuf,strlen(sendbuf),0);
printf("Bytes Sent: %ld\n", bytesSent );
bytesRecv = recv(ConnectSocket,recvbuf,bytesSent,0);
if (bytesRecv <= 0)
printf("\n Error : %d",WSAGetLastError());

WSACleanup();
AnswerRe: how can i send/receive packets to POP3/IMAP server Pin
murali_utr13-Jan-04 18:15
murali_utr13-Jan-04 18:15 
GeneralCircular inclusions... Pin
Anonymous13-Jan-04 15:04
Anonymous13-Jan-04 15:04 
GeneralRe: Circular inclusions... Pin
Christian Graus13-Jan-04 17:26
protectorChristian Graus13-Jan-04 17:26 
GeneralRe: Circular inclusions... Pin
Ryan Binns13-Jan-04 17:35
Ryan Binns13-Jan-04 17:35 
GeneralRe: Circular inclusions... Pin
Anonymous13-Jan-04 18:25
Anonymous13-Jan-04 18:25 
GeneralRe: Circular inclusions... Pin
Marcello16-Jan-04 7:58
Marcello16-Jan-04 7:58 
GeneralMFC SDI App Pin
Irish_GUI13-Jan-04 13:44
Irish_GUI13-Jan-04 13:44 
GeneralRe: MFC SDI App Pin
l a u r e n13-Jan-04 15:32
l a u r e n13-Jan-04 15:32 
GeneralRe: MFC SDI App Pin
Robert A. T. Káldy14-Jan-04 0:44
Robert A. T. Káldy14-Jan-04 0:44 
GeneralCPU usage per process. Pin
ham744613-Jan-04 13:43
ham744613-Jan-04 13:43 
QuestionHow to get the default size of i/o com buffers? Pin
twing13-Jan-04 13:39
twing13-Jan-04 13:39 
QuestionGrouping ctrls in a group box...? Pin
Tommy Svensson13-Jan-04 13:36
Tommy Svensson13-Jan-04 13:36 
AnswerRe: Grouping ctrls in a group box...? Pin
Ryan Binns13-Jan-04 17:40
Ryan Binns13-Jan-04 17:40 
GeneralEdit paste copy problem Pin
Chernobog113-Jan-04 13:11
Chernobog113-Jan-04 13:11 
Generaldll linkage madness Pin
bryce13-Jan-04 12:17
bryce13-Jan-04 12:17 
GeneralRe: dll linkage madness Pin
twing13-Jan-04 14:06
twing13-Jan-04 14:06 
GeneralRe: dll linkage madness Pin
bryce13-Jan-04 14:16
bryce13-Jan-04 14:16 

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.