00001 #pragma once 00002 00003 #ifndef _WIN32_WINNT 00004 #define _WIN32_WINNT _WIN32_WINNT_MAXVER 00005 #endif 00006 00007 #include <afxmt.h> 00008 00009 00010 #define JBXWL_DEFAULT_SMNAME "JBXWL_WinSharedMemory" 00011 00012 00013 00014 // 00015 namespace jbxwl { 00016 00017 00018 class CWinSharedMemory 00019 { 00020 public: 00021 CWinSharedMemory(void); 00022 CWinSharedMemory(const char* name); 00023 CWinSharedMemory(const char* name, int size=1024, BOOL create=FALSE); 00024 00025 virtual ~CWinSharedMemory(void); 00026 00027 protected: 00028 HANDLE m_hMapping = NULL; // メモリマップドファイルのハンドル 00029 void* m_pMappingView = NULL; // ファイルのビューへのポインタ 00030 CMutex* m_pMutex = NULL; // ミューテックスオブジェクト 00031 00032 void createMap(); 00033 00034 void get(); 00035 void put(); 00036 00037 }; 00038 00039 00040 } // namespace