home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / owlsrc.pak / METAFLDC.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-24  |  683 b   |  27 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
  4. //
  5. //   Implementation of DC encapsulation classes
  6. //----------------------------------------------------------------------------
  7. #include <owl/owlpch.h>
  8. #include <owl/dc.h>
  9.  
  10. TMetaFileDC::TMetaFileDC(const char far* filename)
  11. :
  12.   TDC()
  13. {
  14.   Handle = ::CreateMetaFile(filename);
  15.   CheckValid();
  16. }
  17.  
  18. TMetaFileDC::~TMetaFileDC()
  19. {
  20.   if (Handle) {
  21.     if (ShouldDelete)
  22.       // Do not restore objects, Metafiles cleanup after themselves
  23.       ::DeleteMetaFile(Close());
  24.     Handle = 0;
  25.   }
  26. }
  27.