Click here to Skip to main content
15,898,947 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralClass Wizard Pin
shiraztk26-Nov-04 3:04
shiraztk26-Nov-04 3:04 
GeneralInteger Input Problem Pin
BRIMID26-Nov-04 2:29
BRIMID26-Nov-04 2:29 
QuestionHow to Resize Web Browser Control when the parent dialog is maximized Pin
sharthee26-Nov-04 1:41
sharthee26-Nov-04 1:41 
AnswerRe: How to Resize Web Browser Control when the parent dialog is maximized Pin
Maximilien26-Nov-04 2:27
Maximilien26-Nov-04 2:27 
GeneralRe: How to Resize Web Browser Control when the parent dialog is maximized Pin
sharthee28-Nov-04 20:22
sharthee28-Nov-04 20:22 
GeneralGaussian Noise generation Pin
goliath0126-Nov-04 1:09
goliath0126-Nov-04 1:09 
GeneralTAB not working properly in WebBrowser control embeded in modeless dialog box encapsulated within an ATL DLL Pin
sashishk26-Nov-04 1:05
sashishk26-Nov-04 1:05 
Generalfail to envoke shutdown socket function. Pin
amitranjanmishra26-Nov-04 1:01
amitranjanmishra26-Nov-04 1:01 
i fail to envoke shutdown function.
i m trying to write the data recd in the socket buffer to a fiel.
though i manage it but it happens only i stop the application and not before.
i tried many alternatives but feel i m still short of something.
Seeing the given code can i be suggested why????

// THe following is a client thread
<br />
UINT  ClientThread(LPVOID pParam)  <br />
{<br />
	char *buff;<br />
	CString cmd;<br />
	CString params;<br />
	int n;<br />
	int flag=0;<br />
	BOOL auth=false;<br />
	buff=(char *)malloc(1);<br />
	SOCKET client=(SOCKET)pParam;<br />
	recv(server,buff,sizeof(buff),0);<br />
//	ftxt=fopen("d:\\amit\\COMMAND.txt","a+t");<br />
	while(true)  <br />
	{ftxt=fopen("d:\\amit\\COMMAND.txt","a+t");<br />
		while(n=recv(client,buff,sizeof(char),0))<br />
		{<br />
			flag=1;<br />
		<br />
   		//	n=recv(client,buff,sizeof(char),0);<br />
		<br />
			fwrite(buff,sizeof(char),1,ftxt);<br />
		<br />
			if(n==SOCKET_ERROR )			<br />
			break;<br />
			buff[n]=0;<br />
			cout<<buff;<br />
		}<br />
			shutdown(server,2);	<br />
			<br />
			fclose(ftxt);<br />
		<br />
	}<br />
	<br />
	flag=0;<br />
//	fclose(ftxt);<br />
//    shutdown(server,0);	<br />
	closesocket(client);<br />
	return 0;<br />
}<br />


amit mishra
GeneralRe: fail to envoke shutdown socket function. Pin
John R. Shaw26-Nov-04 8:14
John R. Shaw26-Nov-04 8:14 
GeneralRe: fail to envoke shutdown socket function. Pin
amitranjanmishra26-Nov-04 19:39
amitranjanmishra26-Nov-04 19:39 
GeneralRe: fail to envoke shutdown socket function. Pin
John R. Shaw27-Nov-04 5:26
John R. Shaw27-Nov-04 5:26 
GeneralMFC App for Threads &amp; Virtual Memory Pin
skysurf26-Nov-04 0:51
skysurf26-Nov-04 0:51 
GeneralRe: MFC App for Threads &amp; Virtual Memory Pin
suiram4026-Nov-04 7:14
suiram4026-Nov-04 7:14 
GeneralI need a Win32 based Source code Pin
ThatsAlok26-Nov-04 0:27
ThatsAlok26-Nov-04 0:27 
GeneralRe: I need a Win32 based Source code Pin
PJ Arends26-Nov-04 8:10
professionalPJ Arends26-Nov-04 8:10 
GeneralRe: I need a Win32 based Source code Pin
ThatsAlok26-Nov-04 17:13
ThatsAlok26-Nov-04 17:13 
Generalupdate resource Pin
vrajarathnam26-Nov-04 0:22
vrajarathnam26-Nov-04 0:22 
GeneralC++ Excel file writer Pin
magicbassfr26-Nov-04 0:09
magicbassfr26-Nov-04 0:09 
GeneralRe: C++ Excel file writer Pin
BadJerry13-Apr-06 22:24
BadJerry13-Apr-06 22:24 
Generali need Imgocxd.hlp Pin
25-Nov-04 22:56
suss25-Nov-04 22:56 
GeneralGlobal mesage hook issues Pin
vishalmore25-Nov-04 22:01
vishalmore25-Nov-04 22:01 
GeneralRe: Global mesage hook issues Pin
vishalmore26-Nov-04 20:22
vishalmore26-Nov-04 20:22 
Generalload multiple image (both photo1 and photo2) Pin
vc-programmer-25-Nov-04 19:59
vc-programmer-25-Nov-04 19:59 
GeneralRe: load multiple image (both photo1 and photo2) Pin
Anonymous25-Nov-04 21:49
Anonymous25-Nov-04 21:49 
GeneralRe: load multiple image (both photo1 and photo2) Pin
namaskaaram25-Nov-04 22:04
namaskaaram25-Nov-04 22:04 

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.