Ejemplo n.º 1
0
WindowsEventEx::WindowsEventEx(const TCHAR *name)
: WindowsEvent(name)
{
  bool needToInit = GetLastError() != ERROR_ALREADY_EXISTS;
  if (needToInit) {
    setAccessToAll(getHandle());
  }
}
Ejemplo n.º 2
0
WindowsEvent::WindowsEvent(const TCHAR *name)
{
  m_hEvent = CreateEvent(0, FALSE, FALSE, name);
  if (m_hEvent == 0) {
    int errCode = GetLastError();
    StringStorage errMess;
    errMess.format(_T("Cannot create windows event with error = %d"), errCode);
    throw Exception(errMess.getString());
  }

  bool needToInit = GetLastError() != ERROR_ALREADY_EXISTS;
  if (needToInit) {
    setAccessToAll(m_hEvent);
  }
}