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
// my custom messages #define WM_GOWEBSITE (WM_APP + 1)
here is the handler for WM_GOWEBSITEvoid Dlg::On_WebsiteVisit() { m_webbrowser.Navigate("yahoo.com", NULL, NULL, NULL, NULL); return; }
from within my thread, this is how i posted WM_GOWEBSITEth_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!