Click here to Skip to main content
15,886,518 members
Articles / Desktop Programming / WTL

WTL Wizard for Visual Studio .NET

Rate me:
Please Sign up or sign in to vote.
2.88/5 (4 votes)
17 Feb 2002 116.7K   1.2K   24  
An App-Wizard which creates template WTL apps.
// [!output CHILD_FRAME].h : interface of the [!output CHILD_FRAME_CLASS] class
//
/////////////////////////////////////////////////////////////////////////////

#pragma once

class [!output CHILD_FRAME_CLASS] : public [!output CHILD_FRAME_BASE_CLASS]<[!output CHILD_FRAME_CLASS]>
{
public:
	DECLARE_FRAME_WND_CLASS(NULL, IDR_MDICHILD)

[!if USE_VIEW_CLASS]
	[!output VIEW_CLASS] m_view;
[!endif]

	virtual void OnFinalMessage(HWND /*hWnd*/)
	{
		delete this;
	}

	BEGIN_MSG_MAP([!output CHILD_FRAME_CLASS])
[!if USE_VIEW_CLASS]
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
[!endif] //USE_VIEW_CLASS
		MESSAGE_HANDLER(WM_FORWARDMSG, OnForwardMsg)
		CHAIN_MSG_MAP([!output CHILD_FRAME_BASE_CLASS]<[!output CHILD_FRAME_CLASS]>)
	END_MSG_MAP()

[!if USE_VIEW_CLASS]
	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
	{
[!if VIEWTYPE_FORM]
		m_hWndClient = m_view.Create(m_hWnd);
[!endif]
[!if VIEWTYPE_DHTML_OLD ]
		//TODO: Replace with a URL of your choice
		m_hWndClient = m_view.Create(m_hWnd, rcDefault, _T("http://localhost"), [!output VIEW_STYLES], WS_EX_CLIENTEDGE);
[!else]
		m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, [!output VIEW_STYLES], WS_EX_CLIENTEDGE);
[!endif] //VIEWTYPE_FORM

[!if VIEWTYPE_DHTML]

		//TODO: Replace with a URL of your choice
		m_view.Navigate(_T("http://localhost"));
[!endif] //VIEWTYPE_DHTML

		bHandled = FALSE;
		return 1;
	}

[!endif] //USE_VIEW_CLASS
	LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
	{
		LPMSG pMsg = (LPMSG)lParam;

[!if USE_VIEW_CLASS]
		if([!output CHILD_FRAME_BASE_CLASS]<[!output CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg))
			return TRUE;

		return m_view.PreTranslateMessage(pMsg);
[!else]
		return [!output CHILD_FRAME_BASE_CLASS]<[!output CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg);
[!endif]
	}
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Spain Spain
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions