home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / common / msdev98 / template / atl / msdtx.cpp < prev    next >
C/C++ Source or Header  |  1998-06-16  |  885b  |  44 lines

  1. [!if=(FileExists, "FALSE")]
  2. // [!CPPName] : Implementation of [!ClassName]
  3.  
  4. #include "stdafx.h"
  5. #include "[!ProjectName].h"
  6. #include "[!HeaderName]"
  7. [!else]
  8. [!AddIncludeFile(TargetFile, "stdafx.h")]
  9. [!AddStringToSymbol(ProjectName.h, ProjectName, ".h")]
  10. [!AddIncludeFile(TargetFile, ProjectName.h)]
  11. [!AddIncludeFile(TargetFile, HeaderName)]
  12. [!endif]
  13. [!crlf]
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // [!ClassName]
  17. [!crlf]
  18.  
  19. [!if=(ObjectControl, "TRUE")]
  20. HRESULT [!ClassName]::Activate()
  21. {
  22.     HRESULT hr = GetObjectContext(&m_spObjectContext);
  23.     if (SUCCEEDED(hr))
  24.         return S_OK;
  25.     return hr;
  26.  
  27. [!crlf]
  28. BOOL [!ClassName]::CanBePooled()
  29. {
  30. [!if=(CanBePooled, "TRUE")]
  31.     return TRUE;
  32. [!else]
  33.     return FALSE;
  34. [!endif]
  35.  
  36. [!crlf]
  37. void [!ClassName]::Deactivate()
  38. {
  39.     m_spObjectContext.Release();
  40. [!crlf]
  41. [!endif]