HP Remote Graphics Software (RGS) Instrukcja Użytkownika Strona 228

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 227
#define EVENT_SRC "rgsender" // specifies specific event name source
in // HPRemote
BOOL processEvent(LPCTSTR eventServer, LPCTSTR eventSource, DWORD
dwEventNum)
{
HANDLE h;
EVENTLOGRECORD *pevlr;
BYTE bBuffer[BUFFER_SIZE];
DWORD dwRead, dwNeeded;
BOOL result;
// Open, read, close event log ===========================================
if ((h = OpenEventLog(eventServer, eventSource)) == NULL)
{
... report error status ...
return true;
}
// Set the pointer to our buffer. Strings and data will get appended to
the EVENTLOGRECORD structure.
pevlr = (EVENTLOGRECORD *) &bBuffer
// Read the event specified by dwEventNum
result = ReadEventLog(h, // event log handle
EVENTLOG_SEEK_READ | // start at specific event
EVENTLOG_FORWARDS_READ, // advance forward
dwEventNum, // record to read
pevlr, // pointer to buffer
BUFFER_SIZE, // size of buffer
&dwRead, // number of bytes read
&dwNeeded); // bytes in next record
if (CloseEventLog(h) == false)
{
... report error status ...
return true;
}
210 Chapter 10 Remote Application Termination ENWW
Przeglądanie stron 227
1 2 ... 223 224 225 226 227 228 229 230 231 232 233 ... 258 259

Komentarze do niniejszej Instrukcji

Brak uwag