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

C / C++ / MFC

 
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 
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 
You still do not need to allocate a buffer, since all you need is a pointer to a single character.

Hmmm! I should have noted that recv(server,...) was a typo, since that was a typo, then shutdown(server...) is also a typo.

I looked up the functions used and here is what your code will do once the typos are fix:

FIRST TIME TRU LOOP:

1) Read 1 byte from the socket and then ignore it.
2) START INFINITE LOOP {
3) Open a file.
4) While( there is a byte received OR a SOCKET_ERROR ) {
5) copy byte to file. // before checking if error occured
6) if( error )
break;
}
7) Shut down socket so you can no longer send or receive and data.
(This means recv(...) will now always return SOCKET_ERROR)
8) Close file.
9) } // END OF INFINITE LOOP

AFTER FIRST LOOP:

1) START INFINITE LOOP {
2) Open file.
3) While( SOCKET_ERROR ) { // because of shutdown above
4) Write the last character received (during first loop).
5) Break out of loop (since it was a SOCKER_ERROR).
}
6) Try to shut down again (cann't because it was already done).
7) Close file.
8) } // END OF INFINITE LOOP

I do not think that was what you were trying to do, but that is what should be happening. There is also the fact that the INFINITE LOOP cann't be stoped properly (any other way if bad).


INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
GeneralMFC App for Threads & Virtual Memory Pin
skysurf26-Nov-04 0:51
skysurf26-Nov-04 0:51 
GeneralRe: MFC App for Threads & 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 
GeneralRe:Thank You Pin
vc-programmer-25-Nov-04 22:32
vc-programmer-25-Nov-04 22:32 
Generalasync socket problem Pin
User 58385225-Nov-04 18:12
User 58385225-Nov-04 18:12 
GeneralRe: async socket problem Pin
Tim Deveaux26-Nov-04 4:36
Tim Deveaux26-Nov-04 4:36 

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.