Windows CE version 3.0 for PocketPC provides an undocumented component, called webview.dll, which is the rendering engine for Pocket Internet Explorer. This component can be used to provide full web browser functionality in your Windows CE 3.0 PocketPC applications. In addition to rendering HTML pages and GIF and JPEG images, it also provides full frame and form support.
The webview.dll component is an ActiveX control. It supports a number of COM interfaces. The most important of these from a web content rendering point of view is IBrowser. This interface includes methods for navigating to URLs, etc.
The most important method defined by this interface is IBrowser::Navigate. As can be seen from the interface definition below, this method takes a URL argument, and renders the corresponding file. The dwFlags argument is ignored. bstrTargetFrameName specifies the name of the frame to render in. This parameter can be NULL. bstrPostData is used to pass data posted to forms. This can also be NULL.
webview.dll is implemented using ATL. The supported interfaces (such as IBrowser), methods and arguments were determined by browsing the type library in the Windows CE 2.11 version. With Windows CE 3.0, the webview.dll ActiveX control no longer seems to ship with its type information. However, like any good COM server, the interfaces supported in new versions may change, but the interfaces found in previous versions must also be implemented. Thus, all of the IBrowser interface functionality works in the Windows CE 3.0 version.
To demonstrate the use of this component and its IBrowser interface, the download project
includes a sample application called browser.
To use the code:
IBrowser : IDispatch
{
//
// Raw methods provided by interface
//
virtual HRESULT __stdcall Navigate (
BSTR bstrURL,
long dwFlags,
BSTR bstrTargetFrameName,
BSTR bstrPostData ) = 0;
virtual HRESULT __stdcall Refresh ( ) = 0;
virtual HRESULT __stdcall Stop ( ) = 0;
virtual HRESULT __stdcall get_Busy (
long * pVal ) = 0;
virtual HRESULT __stdcall get_Title (
BSTR * pVal ) = 0;
virtual HRESULT __stdcall get_LocationURL (
BSTR * pVal ) = 0;
virtual HRESULT __stdcall get_IsFrame (
long * pVal ) = 0;
virtual HRESULT __stdcall put_IsFrame (
long pVal ) = 0;
virtual HRESULT __stdcall get_ScrollStyle (
long * pVal ) = 0;
virtual HRESULT __stdcall put_ScrollStyle (
long pVal ) = 0;
virtual HRESULT __stdcall get_MarginWidth (
long * pVal ) = 0;
virtual HRESULT __stdcall put_MarginWidth (
long pVal ) = 0;
virtual HRESULT __stdcall get_MarginHeight (
long * pVal ) = 0;
virtual HRESULT __stdcall put_MarginHeight (
long pVal ) = 0;
virtual HRESULT __stdcall FrameNavigate (
BSTR bstrURL,
BSTR bstrTarget,
BSTR bstrSource,
BSTR bstrPostData,
long * Cancel ) = 0;
};
extern "C" const GUID __declspec(selectany) IID_IBrowser =
{0x698e3fc9,0x70c3,0x11d0,{0x81,0xe8,0x00,0xa0,0xc9,0x0a,0xd2,0x0a}};
// {A02531D1-7050-11d3-A5C2-00A0CC537F0A}
static const GUID CLSID_Browser =
{ 0x698E3FCA, 0x70C3, 0x11d0, { 0x81, 0xe8, 0x0, 0xa0, 0xc9, 0x0a, 0xd2, 0x0a } };
#endif /* __WEBVIEW_H */