編寫Windows Mobile上基於WTL封裝的CHTMLCtrl程式注意事項(備忘)

來源:互聯網
上載者:User

WTL::CHtmlCtrl這個類,WTL文檔中很少有說明,故把這些寫下來備忘。

 

    根據WTL 8.0 Final 版本ReadMe.html中的描述,CHtmlCtrl只是把Win32 API的HTML View Control的Handle封裝成一個client類。

 

Windows Template Library

Class Overview

 

usage:        mi base    -    a base class (multiple inheritance)
  client    -    wrapper class for a handle
  as-is    -    to be used directly
  impl    -    implements a window (has WindowProc) or other support
  helper    -    a helper class
  base    -    implementation base class

 

class name: usage: description:

 

CHtmlCtrl client HTML control

 

1. 在CHtmlControl::AddText()之後需要調用CHtmlControl::EndofSource()函數通知控制項。否則顯示一個HTML sourcecode會要等很久。

 

2. 需要在工程檔案中包含以下標頭檔和庫:

#include "piedocvw.h" // for DWebBrowserEvents2<br />#include "webvw.h" // for IPIEHTMLDocument<br />// May be you need the following libs in link settings.<br />piedocvw.lib<br />htmlview.lib<br />webview.lib

 

3. IWebBrowser2 的介面在Windows Mobile 6上是不支援的。

IWebBrowser2 *pWebBrowser2= NULL; // No Interface on Windows Mobile 6

 

4. 如果連結時候(Link)出現 IDD_IPIEHTMLDocument 未定義的錯誤,需要在原始碼中添加對於IDD的定義。

// For fixing the following linking error:<br />// IExchangeRateFrame.obj : error LNK2001: unresolved external symbol IID_IPIEHTMLDocument<br />#ifndef __IID_DEFINED__<br />#define __IID_DEFINED__<br />typedef struct _IID<br />{<br /> unsigned long x;<br /> unsigned short s1;<br /> unsigned short s2;<br /> unsigned char c[8];<br />} IID;<br />#endif // __IID_DEFINED__<br />#ifndef CLSID_DEFINED<br />#define CLSID_DEFINED<br />typedef IID CLSID;<br />#endif // CLSID_DEFINED<br />// from webvw.h MIDL_INTERFACE("CDD75622-07D9-11D3-9309-00C04FAE2101")<br />const IID IID_IPIEHTMLDocument = {0xCDD75622, 0x07D9, 0x11D3, {0x93,0x09,0x00,0xC0,0x4F,0xAE,0x21,0x01}};<br />// End of Fixing<br />

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.