// [!CPPName] : Implementation of [!ClassName]

#include "stdafx.h"
#include "[!ProjectName].h"
#include "[!HeaderName]"

[!crlf]
/////////////////////////////////////////////////////////////////////////////
// [!ClassName]
[!crlf]
[!if=(ErrorInfoEnabled, "TRUE")]
STDMETHODIMP [!ClassName]::InterfaceSupportsErrorInfo(REFIID riid)
{
	static const IID* arr[] = 
	{
		&IID_[!InterfaceName],
	};

	for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
	{
		if (InlineIsEqualGUID(*arr[i],riid))
			return S_OK;
	}
	return S_FALSE;
}
[!endif]
[!crlf]
[!if=(NormalizeDCEnabled, "TRUE")]
HRESULT [!ClassName]::OnDraw(ATL_DRAWINFO& di)
[!else]
HRESULT [!ClassName]::OnDrawAdvanced(ATL_DRAWINFO& di)
[!endif]
{
[!if!=(SubclassWindow, "")]
	return S_OK;
[!else]
	RECT& rc = *(RECT*)di.prcBounds;
	Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom);
	DrawText(di.hdcDraw, _T("ATL 2.0"), -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
	return S_OK;
[!endif]
}
