DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    May 2004
    Posts
    70

    call webbrowser.Navigate within a thread via post message to UI thread

    call webbrowser.Navigate within a thread via post message to UI thread

    i wan to navigate to a website using my webbrowser2 activeX i made. but i need to run threads to execute a webbrowser.Navigate. because webbrowser.Navigate can only be called by the main user interface thread, inorder to use it from within a browser, i would be using the postmessage command to the main thread with a custom message

    heres my custom message

    Code:
    // my custom messages
    #define WM_GOWEBSITE (WM_APP + 1)
    here is the handler for WM_GOWEBSITE
    Code:
    void Dlg::On_WebsiteVisit() 
    {
    	m_webbrowser.Navigate("yahoo.com", NULL, NULL, NULL, NULL);
    	return;
    
    }
    from within my thread, this is how i posted WM_GOWEBSITE
    Code:
    	
    	th_thread->PostMessage( WM_GOWEBSITE , 0,0);
    after running debug , i am very sure the message got posted. But the problem now in the release version is that the page simply does not load.hovering my mouse over the activeX control i get the "half cursor,half hour glass" mouse cursor. the debug version is fine.

    does anyone know what is going on?
    can anyone please help me? thanks in advance!

  2. #2
    Join Date
    May 2004
    Posts
    70
    i managed to work around this using SetTimer(999, 0, NULL):

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links