Loading php page problem with wxIEHtmlWin

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
zhouhao
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2005 7:02 am

Loading php page problem with wxIEHtmlWin

Post by zhouhao » Thu Jan 24, 2008 5:27 am

I have a php page which redirect to different page according to id passed by client application. My client application is a wxWidget application using wxIEHtmlWin. Here is my code:

Code: Select all

wxCriticalSectionLocker locker(s_criticalSection);

wxURL wurl(m_strUrl); 
if (wurl.GetError()==wxURL_NOERR) 
{ 
	wxProtocol& protocol = wurl.GetProtocol();
	wxHTTP* pHTTP = (wxHTTP*)&protocol;
	pHTTP->SetHeader(_T("User-Agent"), _T("My browser"));
	protocol.SetTimeout(10);              
	wxInputStream *in = wurl.GetInputStream(); 
	if ( in && in->IsOk() )
	{
		m_pHtml->LoadUrl(m_strUrl);
		return NULL;
	}
} 

If I run this application on vista or xp with IE 6, everything is fine. But if I run this application under XP with IE7, I got a problem "cannot find page. Make sure the path or internet address is correct". The strange thing is if I move the same code to my main thread, the problem is gone.

I totally lost here. I'll appreciate if anybody could give any suggestion. Thanks

zhouhao
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2005 7:02 am

Post by zhouhao » Thu Jan 24, 2008 7:50 am

Sorry. I think I made a mistake. It has a problem even when I try to open a html page in xp with ie7. There must be something wrong in wxIEHtmlWin.

Post Reply