WTL & Html View

It is easy to create a sample application host web browser using WTL and select Html View from the wizard. There is an article http://www.codeproject.com/KB/wtl/wtlbrowser.aspx which provides a sample class that implemented the event sink which is missing from WTL (but provided by MFC). However the article is old and the class won’t compile with VS2009, and two simple fixes are required:

– Make members public;

– Add template specialization into declaration of class CWebBrowser2:

template<class T,UINT nID=0>
class CWebBrowser2 :   public CWebBrowser2EventsBase , public IDispEventSimpleImpl<nID, CWebBrowser2<T, nID>, &DIID_DWebBrowserEvents2>

Browser.h

Advertisements

Posted on February 2, 2010, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: