CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    170

    InternetOpenUrl in multithread app

    Hi.

    I have two threads in my application. In worker thread i download some html page using InternetOpenUrl,for that use CAmHttpSocket(http://www.codeproject.com/internet/amhttputils.asp).

    In general words in work thread I create connection to the url which is passed from main thread. All works fine. But when i close my application i get User Breakpoint with stack:
    NTDLL! 77f813b1()
    NTDLL! 77fcffd0()
    NTDLL! 77fb6ca7()
    NTDLL! 77fb73fd()
    NTDLL! 77fad09b()
    NTDLL! 77fad16e()
    NTDLL! 77f9ac03()
    KERNEL32! 794569c3()
    doexit(int 0, int 0, int 0) line 392
    exit(int 0) line 279 + 13 bytes
    wWinMainCRTStartup() line 345
    KERNEL32! 7945893d()

    Before close worker thread i close all HINTERNET by InternetCloseHandle().

    I compile my program as UNICODE and with runtime library as Multithreaded DLL. If i don't use InternetOpenUrl all works fine.

    What can cause behaviour like this?

  2. #2
    Join Date
    Dec 2002
    Location
    St.Louis MO, USA
    Posts
    672

    Re: InternetOpenUrl in multithread app

    How did u stop ur worker threads ( if they are downloading some pages or downloading was completed ) . R u using some wait function for ur worker threads before closing ur app. I think ur worker threads are not properly terminated/Exit before closing and may cause such problem. ( Same problem once i have faced in a dll project ).
    A Person who is polite is given goodness and a person who is away from Politeness is away from Goodness.

    NAUMAAN

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