Click here to Skip to main content
15,921,577 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: You've got any idea? [No problem just complained to Chris] Pin
RChin23-Mar-07 2:03
RChin23-Mar-07 2:03 
GeneralRe: You've got any idea? [No problem just complained to Chris] Pin
_808623-Mar-07 4:58
_808623-Mar-07 4:58 
AnswerRe: You've got any idea? [No problem just complained to Chris] Pin
Rick York23-Mar-07 7:06
mveRick York23-Mar-07 7:06 
AnswerRe: You've got any idea? [No problem just complained to Chris] Pin
Stephen Hewitt23-Mar-07 12:02
Stephen Hewitt23-Mar-07 12:02 
QuestionHow to Change Text on Edit and Static Text Controls?... Pin
gunner_uk200023-Mar-07 1:40
gunner_uk200023-Mar-07 1:40 
AnswerRe: How to Change Text on Edit and Static Text Controls?... Pin
CPallini23-Mar-07 1:48
mveCPallini23-Mar-07 1:48 
AnswerRe: How to Change Text on Edit and Static Text Controls?... Pin
Ravi Bhavnani23-Mar-07 6:38
professionalRavi Bhavnani23-Mar-07 6:38 
Questionany lib to be added to make it work or any changes to be done? Pin
ShaluMalu23-Mar-07 1:39
ShaluMalu23-Mar-07 1:39 
hi!
i compiled the following code...
some error is being shown in _endthreadex and _beginthread
mpr.lib and wsock32.lib is included but still not working...
pls tell me if any other changes has to be made...

// HEADER FILE

#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <process.h>
#include<stdlib.h>
#include<stddef.h>

char buffer[]="ANY DATA"; // Static Global Data
/*-------------------------------------------------------------------*/
void MyFunction( void* Arg )
{
SOCKET Client=(*(int *)Arg);

while(1)

{
send(Client,buffer,100,0);
}

_endthreadex(0);
}
/*--------------------------------------------------------------------*/
void main(void)
{
int a,b,c,d; // For Server Address or Address of P1.

int port; // For Port No of Server or Port of P1.

struct sockaddr_in serv_addr,cli_addr;

SOCKET Server;

SOCKET Client;

int clilen=sizeof(cli_addr);

/***************************************************/
/* SOCKET INITIALISATION */
/***************************************************/
WSADATA WsaDat;

if (WSAStartup(MAKEWORD(1,1),&WsaDat) != 0)

{
printf("\n\n WSA Initialization failed! STOP!!!");
exit(1);
}

/***************************************************/
/* SOCKET CREATION */
/***************************************************/

Server = socket(AF_INET, SOCK_STREAM, 0);

if (Server == INVALID_SOCKET)

{
printf("\n\n Socket creation failed!STOP!!!");
exit(1);
}
else
printf("\n\n SOCKET IS CREATED SUCCESSFULLY...");


/***************************************************/
/* SERVER ADDRESS */
/***************************************************/

serv_addr.sin_family=AF_INET;

printf("\n\n ENTER THE SERVER IP ");
scanf("%d%d%d%d",&a,&b,&c,&d);

serv_addr.sin_addr.S_un.S_un_b.s_b1 =a ;
serv_addr.sin_addr.S_un.S_un_b.s_b2 =b ;
serv_addr.sin_addr.S_un.S_un_b.s_b3 =c ;
serv_addr.sin_addr.S_un.S_un_b.s_b4 =d ;

printf("\n\n ENTER THE PORT NO ");
scanf("%d",&port);

serv_addr.sin_port = htons(port);

/***************************************************/
/* BIND THE SOCKET*/
/***************************************************/

if (bind(Server,(struct sockaddr *)(&serv_addr),sizeof(serv_addr)) == SOCKET_ERROR)
{
printf("\n\n Attempt to bind failed!STOP!!!");
}
else
printf("\n\n BIND PROCESS IS CREATED SUCCESSFULLY...\n ");


/***************************************************/
/* LISTEN FOR RECEIVING CONNECTION*/
/***************************************************/

if(listen(Server,5)==SOCKET_ERROR)

printf("\n Error in Listenning The Socket!STOP!!!");

/*---------------------------------------------------*/

while(1)
{

printf("\n SERVER IS RUNNING ...");

Client=accept(Server,(struct sockaddr*)&cli_addr,&clilen);

_beginthread(MyFunction,0,(void *)&Client);
}
getch();

}

tell me the solution to remove the error:
unresolved symbol_@winmain16

pls do reply me as soon as possible..
QuestionRe: any lib to be added to make it work or any changes to be done? Pin
Programm3r23-Mar-07 2:57
Programm3r23-Mar-07 2:57 
AnswerRe: any lib to be added to make it work or any changes to be done? Pin
ShaluMalu23-Mar-07 3:37
ShaluMalu23-Mar-07 3:37 
QuestionRemove focus on a disabled tab item Pin
sireesha_sree23-Mar-07 1:39
sireesha_sree23-Mar-07 1:39 
AnswerRe: Remove focus on a disabled tab item Pin
Phil J Pearson23-Mar-07 7:48
Phil J Pearson23-Mar-07 7:48 
QuestionProblem about ListBox item Pin
Chen-XuNuo23-Mar-07 1:36
Chen-XuNuo23-Mar-07 1:36 
AnswerRe: Problem about ListBox item Pin
Mark Salsbery23-Mar-07 8:05
Mark Salsbery23-Mar-07 8:05 
AnswerRe: Problem about ListBox item Pin
DLChambers23-Mar-07 15:13
DLChambers23-Mar-07 15:13 
QuestionHow to find if a particular system is active or not in a LAN? Pin
Malini Nair23-Mar-07 1:28
Malini Nair23-Mar-07 1:28 
AnswerRe: How to find if a particular system is active or not in a LAN? Pin
Programm3r23-Mar-07 2:49
Programm3r23-Mar-07 2:49 
QuestionRe: How to find if a particular system is active or not in a LAN? Pin
Mark Salsbery23-Mar-07 8:09
Mark Salsbery23-Mar-07 8:09 
QuestionC++.Net 2005 With Crystal Reports Pin
Pubudu Wijeyaratne23-Mar-07 1:06
Pubudu Wijeyaratne23-Mar-07 1:06 
QuestionHow to include a library file? Pin
Malini Nair23-Mar-07 0:26
Malini Nair23-Mar-07 0:26 
AnswerRe: How to include a library file? Pin
toxcct23-Mar-07 0:29
toxcct23-Mar-07 0:29 
AnswerRe: How to include a library file? Pin
Nibu babu thomas23-Mar-07 1:17
Nibu babu thomas23-Mar-07 1:17 
GeneralRe: How to include a library file? Pin
_808623-Mar-07 1:51
_808623-Mar-07 1:51 
GeneralRe: How to include a library file? Pin
Nibu babu thomas23-Mar-07 2:15
Nibu babu thomas23-Mar-07 2:15 
GeneralRe: How to include a library file? Pin
_808623-Mar-07 4:56
_808623-Mar-07 4:56 

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.