[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/27/2009 at 09:54AM PDT, ID: 24847920 | Points: 500
[x]
Attachment Details

C++/MFC application that uses an embedded Internet Explorer control to a new device running Windows CE 6.0

Asked by RandalBarnes in Windows MFC Programming, Embedded Hardware, Microsoft Visual C++, Windows Mobile (Pocket PC / Win CE) Operating Systems, Windows OLE Programming

Tags: CE C++ MFC IE

I'm trying to port a C++/MFC application that uses an embedded Internet Explorer control to a new device running Windows CE 6.0. The browser control is successfully created and can display pages and follow links, but submitting an HTML form does not work. Nothing happens when I press the submit button, either on local pages or web sites like MSN, Yahoo or Google. I've tried running the application in the debugger, but I don't get any exception and the 'BeforeNavigate2" callback is never invoked.

I looked at the two Internet Explorer sample applications in the Windows CE 6.0 Platform Builder under the %WINCEROOT%\Public\Ie\Oak directory to see if I was creating the control correctly. The IESIMPLE example is able to submit forms, but the IESAMPLE does not. The difference is that IESIMPLE always calls CoInitializeEx with COINIT_MULTITHREADED and IESAMPLE calls it with COINIT_APARTMENTTHREADED if the device supports DCOM (which the device I'm using does). For some reason, submitting HTML forms only works in a multi-threaded apartment. Has anyone else seen this problem or know how to work around it? I've tried searching the MSDN forums and web, but haven't found any references to anything like this. Maybe it's specific to how the specific device I'm using is configured. I've used an embedded web browser control in both Windows Mobile and XP applications for years (in a single threaded COM
apartment) and haven't had a problem before. The new device I'm trying to port to is the WebDT 430 (www.dtresearch.com/product/dt430/index.htm)
and I'm using Visual Studio 2008 and the SDK I downloaded from their web site.

Does anyone have any ideas for how to work around this problem? I'm not familiar with all the COM internals or different apartment models, but I've read that MFC needs to be initialized as a single-threaded apartment so I can't just call CoInitializeEx with COINIT_MULTITHREADED at the beginning of my application. Does that mean I need to create a separate thread for just the web browser and try to marshall the interface between the browser thread and the MFC thread? Will the browser callbacks like BeforeNavigate2 and DocumentComplete work across threads?

Any help or ideas would be appreciated.
[+][-]10/27/09 10:48 AM, ID: 25675313

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 03:38 PM, ID: 25678483

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 05:35 PM, ID: 25679082

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/27/09 07:59 PM, ID: 25679675

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 08:22 PM, ID: 25679740

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/30/09 09:37 AM, ID: 25704643

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625