Click here to Skip to main content
15,897,291 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Select Item in ListView Control In VC++ 6 Win32 API Pin
David Crow25-Mar-08 5:24
David Crow25-Mar-08 5:24 
GeneralCFtpConnection::Close Pin
William Engberts25-Mar-08 4:22
William Engberts25-Mar-08 4:22 
GeneralRe: CFtpConnection::Close Pin
led mike25-Mar-08 5:32
led mike25-Mar-08 5:32 
GeneralRe: CFtpConnection::Close Pin
William Engberts25-Mar-08 23:19
William Engberts25-Mar-08 23:19 
GeneralRe: CFtpConnection::Close Pin
led mike26-Mar-08 5:07
led mike26-Mar-08 5:07 
GeneralRe: CFtpConnection::Close Pin
William Engberts27-Mar-08 0:56
William Engberts27-Mar-08 0:56 
GeneralRe: CFtpConnection::Close Pin
led mike27-Mar-08 5:19
led mike27-Mar-08 5:19 
GeneralRe: CFtpConnection::Close Pin
Randor 25-Mar-08 6:05
professional Randor 25-Mar-08 6:05 
First let me say that I am not a CInternetSession expert, simply because I generally migrate to the lower levels of development. However with that being said I can make a guess to what is happening based on the error message you have posted.

You see, when you attempt to open a connection... a three way handshake takes place. Here is a fairly good visual explanation:
http://www.youtube.com/watch?v=z40w3G8szK0[^]

And when you close the connection you must also wait for a handshake sequence to complete. Unfortunately I could not find a video for this. Maybe this URL will suffice:
http://www.freesoft.org/CIE/Course/Section4/11.htm[^]

Here is Microsofts detailed explanation on the whole thing.

http://support.microsoft.com/kb/172983[^]

In laymens terms... when you close() a connection. What is happening is that a message called FIN is sent to the other side and your client goes into a FIN_WAIT state. At this point it is waiting for the other side to respond. Unfortunately with your code:

CInternetSession::Close ();
delete m_Session;


You are probably deleting the object before it has completed the connection termination handshake.

I believe you need to implement a status callback:
http://msdn2.microsoft.com/en-us/library/73cf84cs(VS.80).aspx[^]

And inside OnStatusCallback() you need to wait for INTERNET_STATUS_CONNECTION_CLOSED status.

http://msdn2.microsoft.com/en-us/library/4bwy8hw5.aspx[^]

Best Wishes,
-David Delaune
GeneralRetreive Createion and Modification time for Remote file Pin
chetanjoshi925-Mar-08 4:14
chetanjoshi925-Mar-08 4:14 
GeneralRe: Retreive Createion and Modification time for Remote file Pin
Peter Weyzen25-Mar-08 19:45
Peter Weyzen25-Mar-08 19:45 
GeneralNDIS Driver Development Pin
Eakalavya25-Mar-08 3:26
Eakalavya25-Mar-08 3:26 
GeneralRe: NDIS Driver Development Pin
Randor 25-Mar-08 5:17
professional Randor 25-Mar-08 5:17 
QuestionStart Process From Windows Service with Logged in User Token Pin
Somnath_Mali25-Mar-08 1:47
Somnath_Mali25-Mar-08 1:47 
QuestionHow to call c program from MFC/C++? Pin
johndoelee25-Mar-08 0:46
johndoelee25-Mar-08 0:46 
AnswerRe: How to call c program from MFC/C++? Pin
Rajkumar R25-Mar-08 1:08
Rajkumar R25-Mar-08 1:08 
AnswerRe: How to call c program from MFC/C++? Pin
CPallini25-Mar-08 1:36
mveCPallini25-Mar-08 1:36 
AnswerRe: How to call c program from MFC/C++? Pin
David Crow25-Mar-08 3:30
David Crow25-Mar-08 3:30 
AnswerRe: How to call c program from MFC/C++? Pin
johndoelee1-Apr-08 6:31
johndoelee1-Apr-08 6:31 
AnswerRe: How to call c program from MFC/C++? Pin
johndoelee26-Mar-08 3:13
johndoelee26-Mar-08 3:13 
AnswerRe: How to call c program from MFC/C++? Pin
Gofur Halmurat28-Mar-08 5:55
Gofur Halmurat28-Mar-08 5:55 
QuestionEasy way to get any urls sourse code? Pin
Gofur Halmurat24-Mar-08 23:11
Gofur Halmurat24-Mar-08 23:11 
AnswerRe: Easy way to get any urls sourse code? Pin
David Crow25-Mar-08 3:40
David Crow25-Mar-08 3:40 
AnswerRe: Easy way to get any urls sourse code? Pin
Gofur Halmurat26-Mar-08 5:58
Gofur Halmurat26-Mar-08 5:58 
QuestionHooking Pin
somasundarambe24-Mar-08 23:06
somasundarambe24-Mar-08 23:06 
QuestionRe: Hooking Pin
David Crow25-Mar-08 3:47
David Crow25-Mar-08 3:47 

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.