Click here to Skip to main content
15,886,807 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Need to get .obj file names of Executable(which one is crrently executing) at runtime programatically in VC++? Pin
enhzflep5-Apr-10 2:41
enhzflep5-Apr-10 2:41 
GeneralRe: Need to get .obj file names of Executable(which one is crrently executing) at runtime programatically in VC++? Pin
glitteringsound5-Apr-10 3:03
glitteringsound5-Apr-10 3:03 
GeneralRe: Need to get .obj file names of Executable(which one is crrently executing) at runtime programatically in VC++? Pin
enhzflep5-Apr-10 3:28
enhzflep5-Apr-10 3:28 
AnswerRe: Need to get .obj file names of Executable(which one is crrently executing) at runtime programatically in VC++? Pin
Chris Meech5-Apr-10 4:54
Chris Meech5-Apr-10 4:54 
Questionlocalization issue Pin
Member 5903105-Apr-10 0:14
Member 5903105-Apr-10 0:14 
QuestionCListCtrl SortGroups by name Pin
Abinash Mohanty4-Apr-10 23:14
Abinash Mohanty4-Apr-10 23:14 
AnswerRe: CListCtrl SortGroups by name Pin
David Crow2-Jan-11 15:01
David Crow2-Jan-11 15:01 
QuestionC++ socket and thread [modified] Pin
canard294-Apr-10 22:29
canard294-Apr-10 22:29 
Hi,

I have a small programm which listen a socket in a new thread. but I want to restart the porgramm after the first message.

Start the thread in main.cpp
<code>hThread = CreateThread( 
				NULL,                       
				0,                           
				ThreadFunc,                
				&dwThrdParam,              
				0,                          
				&dwThreadId);  </code> 


The programm :
<code>DWORD WINAPI ThreadFunc( LPVOID lpParam ) 
{ 
			WSAStartup(MAKEWORD(2,2),&initialisation_win32);
			socket_recevoir=socket(AF_INET,SOCK_DGRAM,0);
			information_recevoir.sin_family=AF_INET;
			information_recevoir.sin_addr.s_addr=INADDR_ANY; 
			information_recevoir.sin_port=htons(25);

			bind(socket_recevoir,(struct sockaddr*)&information_recevoir,sizeof(information_recevoir));

			tempo=sizeof(information_recevoir); 
			nb_caracters=recvfrom(socket_recevoir,buffer,1515,0,(struct sockaddr*)&information_recevoir,&tempo);
			buffer[nb_caracters]=0;

			if (nb_caracters >0)
			{
				ExecuteCommand(buffer, NULL, 0);
			}
	
		
			closesocket(socket_recevoir);
		

	return 0; 
} </code>  


In main.cpp, I want to call again this programm.

Can you help me please ?
modified on Monday, April 5, 2010 10:42 AM

AnswerRe: C++ socket and thread Pin
Moak4-Apr-10 23:29
Moak4-Apr-10 23:29 
GeneralRe: C++ socket and thread Pin
canard295-Apr-10 2:14
canard295-Apr-10 2:14 
GeneralRe: C++ socket and thread Pin
Moak5-Apr-10 3:04
Moak5-Apr-10 3:04 
GeneralRe: C++ socket and thread Pin
canard295-Apr-10 4:47
canard295-Apr-10 4:47 
GeneralRe: C++ socket and thread Pin
Moak5-Apr-10 8:25
Moak5-Apr-10 8:25 
QuestionListview row color Pin
arun_pk4-Apr-10 22:26
arun_pk4-Apr-10 22:26 
AnswerRe: Listview row color Pin
Code-o-mat5-Apr-10 0:30
Code-o-mat5-Apr-10 0:30 
AnswerRe: Listview row color Pin
Rolf Kristensen12-Apr-10 9:33
Rolf Kristensen12-Apr-10 9:33 
Questionerror C2440 Pin
MsmVc4-Apr-10 21:28
MsmVc4-Apr-10 21:28 
AnswerRe: error C2440 Pin
Adam Roderick J4-Apr-10 21:35
Adam Roderick J4-Apr-10 21:35 
GeneralRe: error C2440 Pin
MsmVc4-Apr-10 21:55
MsmVc4-Apr-10 21:55 
GeneralRe: error C2440 Pin
Adam Roderick J4-Apr-10 22:00
Adam Roderick J4-Apr-10 22:00 
GeneralRe: error C2440 Pin
MsmVc4-Apr-10 22:06
MsmVc4-Apr-10 22:06 
GeneralRe: error C2440 Pin
Adam Roderick J4-Apr-10 22:21
Adam Roderick J4-Apr-10 22:21 
GeneralRe: error C2440 Pin
MsmVc4-Apr-10 22:31
MsmVc4-Apr-10 22:31 
GeneralRe: error C2440 Pin
Game-point4-Apr-10 22:45
Game-point4-Apr-10 22:45 
GeneralRe: error C2440 Pin
MsmVc4-Apr-10 23:11
MsmVc4-Apr-10 23:11 

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.