home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / MS_VC.50 / SharedIDE / TEMPLATE / ATL / CONTROL.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-18  |  996 b   |  43 lines

  1. // [!CPPName] : Implementation of [!ClassName]
  2.  
  3. #include "stdafx.h"
  4. #include "[!ProjectName].h"
  5. #include "[!HeaderName]"
  6.  
  7. [!crlf]
  8. /////////////////////////////////////////////////////////////////////////////
  9. // [!ClassName]
  10. [!crlf]
  11. [!if=(ErrorInfoEnabled, "TRUE")]
  12. STDMETHODIMP [!ClassName]::InterfaceSupportsErrorInfo(REFIID riid)
  13. {
  14.     static const IID* arr[] = 
  15.     {
  16.         &IID_[!InterfaceName],
  17.     };
  18.  
  19.     for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
  20.     {
  21.         if (InlineIsEqualGUID(*arr[i],riid))
  22.             return S_OK;
  23.     }
  24.     return S_FALSE;
  25. }
  26. [!endif]
  27. [!crlf]
  28. [!if=(NormalizeDCEnabled, "TRUE")]
  29. HRESULT [!ClassName]::OnDraw(ATL_DRAWINFO& di)
  30. [!else]
  31. HRESULT [!ClassName]::OnDrawAdvanced(ATL_DRAWINFO& di)
  32. [!endif]
  33. {
  34. [!if!=(SubclassWindow, "")]
  35.     return S_OK;
  36. [!else]
  37.     RECT& rc = *(RECT*)di.prcBounds;
  38.     Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom);
  39.     DrawText(di.hdcDraw, _T("ATL 2.0"), -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
  40.     return S_OK;
  41. [!endif]
  42. }
  43.