CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 1999
    Posts
    24

    Aysc Download over HTTP

    I need to async downloading of a file, preferly over HTTP port 80. I don't really know where yo start. I'm starting to look at The MFC inetrnet classes, but I'm not to found of linking to the MFC library. It's to big. Thanks


  2. #2
    Join Date
    Jul 1999
    Posts
    3

    Have you found the answer?

    I'm doing a similiar thing. I need to be able to close the connections if they "hang" for a while.
    However when I create an asynchronous CInternetSession object and then do:
    OpenRequest...
    AddRequestHeaders...
    SendRequest...
    I get an overlapped I/O pending Error when I hit SendRequest. Any ideas? Maybe sample code?
    Thanks for the help!


  3. #3
    Join Date
    May 1999
    Posts
    12

    Re: Have you found the answer?

    No async support
    INTERNET_FLAG_ASYNC was never supported by MFC. The presence of this flag now causes debug builds of MFC to assert



  4. #4
    Join Date
    Jul 1999
    Posts
    3

    Re: Have you found the answer?

    Thanks! I was just searching through the MSDN and found the same thing (no async with WinInet Classes). I'm rewriting my code to use WinInet APIs (it's also a multithreading app - every thread spwans it's own Internet connection, which is asynchronous) - I'm still getting pending IO error when I'm trying to use InternetReadFile. Any suggestions or simple code (for the async WinInet APIs for the HTTP files) would be greatly appreciated!
    Thanks!



  5. #5
    Join Date
    May 1999
    Posts
    10

    Re: Have you found the answer?

    Could you use URLDownloadToFile or URLDownloadToCacheFile? It has a callback you can use to interrupt the transfer.
    Rodica


  6. #6
    Join Date
    Nov 2003
    Posts
    39
    Hi!

    how did you solved the problem?
    Any ideas, code is wellcomed!

    Thanks for your answer!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured