// Created: 08.06.01
// RCS-ID: $Id$
// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// License: wxWindows license
+// License: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
- #pragma implementation "snglinst.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// wxSingleInstanceCheckerImpl: the real implementation class
// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxSingleInstanceCheckerImpl
+class WXDLLIMPEXP_BASE wxSingleInstanceCheckerImpl
{
public:
wxSingleInstanceCheckerImpl()
bool Create(const wxString& name)
{
- m_hMutex = ::CreateMutex(NULL, FALSE, name);
+ m_hMutex = ::CreateMutex(NULL, FALSE, name.wx_str());
if ( !m_hMutex )
{
wxLogLastError(_T("CreateMutex"));
- return FALSE;
+ return false;
}
// mutex was either created or opened - see what really happened
m_wasOpened = ::GetLastError() == ERROR_ALREADY_EXISTS;
- return TRUE;
+ return true;
}
bool WasOpened() const
{
- wxCHECK_MSG( m_hMutex, FALSE,
+ wxCHECK_MSG( m_hMutex, false,
_T("can't be called if mutex creation failed") );
return m_wasOpened;
// the mutex handle, may be NULL
HANDLE m_hMutex;
+
+ DECLARE_NO_COPY_CLASS(wxSingleInstanceCheckerImpl)
};
// ============================================================================
// ============================================================================
bool wxSingleInstanceChecker::Create(const wxString& name,
- const wxString& path)
+ const wxString& WXUNUSED(path))
{
wxASSERT_MSG( !m_impl,
_T("calling wxSingleInstanceChecker::Create() twice?") );
bool wxSingleInstanceChecker::IsAnotherRunning() const
{
- wxCHECK_MSG( m_impl, FALSE, _T("must call Create() first") );
+ wxCHECK_MSG( m_impl, false, _T("must call Create() first") );
// if the mutex had been opened, another instance is running - otherwise we
// would have created it