Guest User

Untitled

a guest
Apr 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. class View
  2. {
  3. public:
  4. // needed by CPersistentStorage
  5. View()
  6. {
  7. }
  8.  
  9. View(CFileMapping & fm) : m_lpBase(MapViewOfFile(fm.m_hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0))
  10. {
  11. if (m_lpBase == NULL)
  12. {
  13. AtlThrowLastWin32();
  14. }
  15. }
  16.  
  17. ~View()
  18. {
  19. UnmapViewOfFile(m_lpBase);
  20. }
  21.  
  22. View & operator=(View & that)
  23. {
  24. m_lpBase = that.m_lpBase;
  25. that.m_lpBase = NULL;
  26. return *this;
  27. }
  28.  
  29. volatile LPVOID m_lpBase;
  30. };
Add Comment
Please, Sign In to add comment