Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo Leutz,

ich möchte gerne verschiedene Events im EventLog von meinem Betriebssystem sichtbar machen. Leider bekomme ich eins nicht hin, ich kann keine Beschreibung ausgeben, es wird nur eine Ereignisinformationen ausgegeben.

-----

bool CLogger::ReportEventLog()

{

CString pstrUsername;

CString pstrDomain;

PSID psidOwner;

LPTSTR pszSrcName = _T("programmname");

GetCallProcessUser(&pstrUsername, &pstrDomain, &psidOwner);

HANDLE handle;

handle= RegisterEventSource(NULL, pszSrcName);

if (handle == NULL)

{

AfxMessageBox(_T("Could not register the event source."));

return false;

}

LPCSTR lpMsgBuf = _T("Test ist erfolgt");

int n = strlen(lpMsgBuf);

if (!ReportEvent(handle , EVENTLOG_ERROR_TYPE, 0, 1024,psidOwner,1,0,&lpMsgBuf,NULL);

{

AfxMessageBox(_T("Could not report the event."));

}

DeregisterEventSource(handle);

return true;

}

-----

Hat mir jemand eine fertig funktionierendes Beispiel? (Class)

Oder vielleicht eine sehr gut Beschreibung (auch gern in Deutsch).

THX

Hat mir jemand eine fertig funktionierendes Beispiel? (Class)

An deinem Code ist nichts falsch. Vielleicht ist dir nicht klar, wie das mit den Events funktioniert. Die Texte fürt die Events kommen aus der Message-Datei. Was du bei ReportEvent übergibst, füllt nur die Platzhalter im Text. Wenn deine Message-Datei nicht in Ordnung ist, kann das nicht funktionieren.

Siehe dazu auch hier:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/event_identifiers.asp

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.