Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Month Calander Pin
mcsherry23-Mar-06 3:05
mcsherry23-Mar-06 3:05 
QuestionScrolling issue Pin
anilksingh23-Mar-06 2:21
anilksingh23-Mar-06 2:21 
AnswerRe: Scrolling issue Pin
Waldermort23-Mar-06 2:38
Waldermort23-Mar-06 2:38 
GeneralRe: Scrolling issue Pin
anilksingh23-Mar-06 17:53
anilksingh23-Mar-06 17:53 
QuestionUrgent help required !!! Pin
seekin_nirvana23-Mar-06 2:13
seekin_nirvana23-Mar-06 2:13 
AnswerRe: Urgent help required !!! Pin
Cedric Moonen23-Mar-06 2:25
Cedric Moonen23-Mar-06 2:25 
Answer[Message Deleted] Pin
seekin_nirvana23-Mar-06 3:05
seekin_nirvana23-Mar-06 3:05 
AnswerRe: Urgent help required !!! Pin
seekin_nirvana23-Mar-06 3:10
seekin_nirvana23-Mar-06 3:10 
there were some mistakes in previous program regarding header files. i am posting it again

#include<sys types.h="">
#include <winsock2.h>
//#include <process.h>
#include<windows.h>
#include<stdlib.h>
#include<stdio.h>

#include <stddef.h>

#include <conio.h>


void CheckKey(void *);

void main()
{
int cont,create_socket,new_socket,addrlen;
int bufsize = 1024;
char *buffer =(char *) malloc(bufsize);
struct sockaddr_in address;

WSADATA wsaData;

if(WSAStartup(0x202,&wsaData) == SOCKET_ERROR)
{
return ;
}

//printf("\x1B[2J");
if ((create_socket = socket(AF_INET,SOCK_STREAM,0)) > 0)
printf("The socket was created\n");
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(15000);
if (bind(create_socket,(struct sockaddr *)&address,sizeof(address)) == 0)
printf("Binding Socket\n");
int retval =listen(create_socket,SOMAXCONN);
addrlen = sizeof(struct sockaddr_in);


DWORD ThreadId;
HANDLE hWnd;


hWnd =CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)CheckKey,NULL,0,&ThreadId);
//CreateThread(CheckKey, 0, NULL );

new_socket = accept(create_socket,(struct sockaddr *)&address,&addrlen);
if (new_socket > 0){
recv(new_socket,buffer,bufsize,0);
printf("The Client %s is connected...\n",buffer);
//for(cont=1;cont<5000;cont++)
// printf("\x7");
}





do{
printf("Message to send: ");
gets(buffer);
send(new_socket,buffer,bufsize,0);
recv(new_socket,buffer,bufsize,0);
printf("Message recieved: %s\n",buffer);
}while(strcmp(buffer,"/q")); //user 'q' to quit
//close(new_socket);
//close(create_socket);
}






//void CheckKey()
//{

// new_socket = accept(create_socket,(struct sockaddr *)&address,&addrlen);
// if (new_socket > 0){

// printf("The Client %s is connected...\n",inet_ntoa(address.sin_addr));
//for(cont=1;cont<5000;cont++)
// printf("\x7");

// }

//}
/*void CheckKey(void * val)
{
while(1)
{
new_socket = accept(create_socket,(struct sockaddr *)&address,&addrlen);
if (new_socket > 0)
{
recv(new_socket,buffer,bufsize,0);
printf("The Client %s is connected...\n",buffer);
}
}
return ;
}*/




//DWORD WINAPI ValidateData(LPVOID Parameter)
//{
//Get the information about client entity
//SOCKET client = (SOCKET)Parameter;
//int rVal; //Return val
//char buf[11]; //used to send the validated data to client

//Get the data form client
//rVal = recv(client,buf,11,0);
//here we are performing simple check, the data came form client
//is valid or not
//at this point you can check your own data also, which needs some modification
//if(strcmp(buf,"Data On Socket"))
//{
//Send back the data to the client
//rVal = send(client,"YES",3,0);
//}
//else
//{
//Send back the data to the client
//rVal = send(client,"NO",2,0);
//}
//return 0;
//}
AnswerRe: Urgent help required !!! Pin
seekin_nirvana23-Mar-06 3:14
seekin_nirvana23-Mar-06 3:14 
GeneralRe: Urgent help required !!! Pin
Waldermort23-Mar-06 3:23
Waldermort23-Mar-06 3:23 
GeneralRe: Urgent help required !!! Pin
Cedric Moonen23-Mar-06 3:12
Cedric Moonen23-Mar-06 3:12 
GeneralRe: Urgent help required !!! Pin
seekin_nirvana23-Mar-06 3:35
seekin_nirvana23-Mar-06 3:35 
GeneralRe: Urgent help required !!! Pin
Cedric Moonen23-Mar-06 3:40
Cedric Moonen23-Mar-06 3:40 
GeneralRe: Urgent help required !!! Pin
Justin Tay23-Mar-06 3:57
Justin Tay23-Mar-06 3:57 
AnswerRe: Urgent help required !!! Pin
Stephen Hewitt23-Mar-06 11:59
Stephen Hewitt23-Mar-06 11:59 
QuestionDialog callback function Pin
Waldermort23-Mar-06 2:09
Waldermort23-Mar-06 2:09 
AnswerRe: Dialog callback function Pin
PJ Arends23-Mar-06 7:10
professionalPJ Arends23-Mar-06 7:10 
GeneralRe: Dialog callback function Pin
Waldermort23-Mar-06 7:40
Waldermort23-Mar-06 7:40 
Questionrelated shellexecute function Pin
baldha rakesh23-Mar-06 2:01
baldha rakesh23-Mar-06 2:01 
AnswerRe: related shellexecute function Pin
toxcct23-Mar-06 2:12
toxcct23-Mar-06 2:12 
GeneralRe: related shellexecute function Pin
baldha rakesh23-Mar-06 2:15
baldha rakesh23-Mar-06 2:15 
GeneralRe: related shellexecute function Pin
toxcct23-Mar-06 2:17
toxcct23-Mar-06 2:17 
GeneralRe: related shellexecute function Pin
baldha rakesh23-Mar-06 2:35
baldha rakesh23-Mar-06 2:35 
GeneralRe: related shellexecute function Pin
toxcct23-Mar-06 2:37
toxcct23-Mar-06 2:37 
AnswerRe: related shellexecute function Pin
Shoaib Patel23-Mar-06 2:27
Shoaib Patel23-Mar-06 2:27 

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.