#include
#include
#include
void main()
{
LPCTSTR lpServerName = "\\\\adt246";
LPCTSTR lpSourceName = "Application";
HANDLE hAppLog = 0;
BOOL bReadReturn;
char eventBuffer[500];
LPVOID lpBuffer = &eventBuffer;
DWORD dwBytesRead=0;
DWORD dwBytesNeeded=0;
DWORD dwErrorCode;
hAppLog=OpenEventLog(lpServerName,lpSourceName);
if(!hAppLog==NULL)
{
bReadReturn = ReadEventLog(hAppLog,
EVENTLOG_FORWARDS_READ,
0,
lpBuffer,
500,
&dwBytesRead,
&dwBytesNeeded);
}
if(!bReadReturn)
{
dwErrorCode=GetLastError();
printf("Error code is %d\n",dwErrorCode);
}
}
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only