123456789101112131415161718192021222324252627 |
- // MyLock.cpp: implementation of the MyLock class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "MyLock.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- extern HANDLE Lock(TCHAR* name);
- extern bool Unlock(HANDLE mutex);
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- MyLock::MyLock(CString name)
- {
- m_handle=Lock((TCHAR*)(LPCTSTR)name);
- }
- MyLock::~MyLock()
- {
- Unlock(m_handle);
- }
|