Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMS Money...how do they do it? Pin
BigZee21-Mar-05 8:29
BigZee21-Mar-05 8:29 
AnswerRe: MS Money...how do they do it? Pin
nlecren21-Mar-05 8:44
nlecren21-Mar-05 8:44 
AnswerRe: MS Money...how do they do it? Pin
Ravi Bhavnani21-Mar-05 9:56
professionalRavi Bhavnani21-Mar-05 9:56 
Generaldouble **abc Pin
TUMB21-Mar-05 7:59
TUMB21-Mar-05 7:59 
GeneralRe: double **abc Pin
David Crow21-Mar-05 8:36
David Crow21-Mar-05 8:36 
GeneralRe: double **abc Pin
toxcct21-Mar-05 22:25
toxcct21-Mar-05 22:25 
GeneralHELP: Printing in a region Pin
Vitaly Tomilov21-Mar-05 6:30
Vitaly Tomilov21-Mar-05 6:30 
GeneralEvent enumeration:compiles,links no output Pin
brilliant10121-Mar-05 5:58
brilliant10121-Mar-05 5:58 
It complies and links but shows no output.It is suppose to enlist the application log files.


#include <windows.h>
#include <stdio.h>


void DisplayEntries( )
{
const int BUFFER_SIZE=1000;
HANDLE h;
EVENTLOGRECORD *pevlr;
BYTE bBuffer[BUFFER_SIZE];
DWORD dwRead, dwNeeded, cRecords, dwThisRecord = 0;

// Open the Application event log.

h = OpenEventLog( NULL, // use local computer
"Application"); // source name
if (h == NULL) { printf("yahooo1");}
// ErrorExit("Could not open the Application event log.");

pevlr = (EVENTLOGRECORD *) &bBuffer;

// Opening the event log positions the file pointer for this
// handle at the beginning of the log. Read the records
// sequentially until there are no more.

while (ReadEventLog(h, // event log handle
EVENTLOG_FORWARDS_READ | // reads forward
EVENTLOG_SEQUENTIAL_READ, // sequential read
0, // ignored for sequential reads
pevlr, // pointer to buffer
BUFFER_SIZE, // size of buffer
&dwRead, // number of bytes read
&dwNeeded)) // bytes in next record
{
while (dwRead > 0)
{
// Print the event identifier, type, and source name.
// The source name is just past the end of the
// formal structure.

printf("%02d Event ID: 0x%08X ",
dwThisRecord++, pevlr->EventID);
printf("EventType: %d Source: %s\n",
pevlr->EventType, (LPSTR) ((LPBYTE) pevlr +
sizeof(EVENTLOGRECORD)));

dwRead -= pevlr->Length;
pevlr = (EVENTLOGRECORD *)
((LPBYTE) pevlr + pevlr->Length);
}

pevlr = (EVENTLOGRECORD *) &bBuffer;
}

CloseEventLog(h);
}

int WINAPI WinMain(HINSTANCE h,HINSTANCE p,LPSTR l,int n)
{
DisplayEntries();


return 0;

}
GeneralRe: Event enumeration:compiles,links no output Pin
brilliant10121-Mar-05 6:00
brilliant10121-Mar-05 6:00 
GeneralRe: Event enumeration:compiles,links no output Pin
David Crow21-Mar-05 7:27
David Crow21-Mar-05 7:27 
GeneralHardware enumeration Pin
brilliant10121-Mar-05 5:57
brilliant10121-Mar-05 5:57 
GeneralRe: Hardware enumeration Pin
brilliant10121-Mar-05 5:59
brilliant10121-Mar-05 5:59 
GeneralRe: Hardware enumeration Pin
David Crow21-Mar-05 7:24
David Crow21-Mar-05 7:24 
GeneralCOM Pin
act_x21-Mar-05 4:26
act_x21-Mar-05 4:26 
GeneralRe: COM Pin
Vitaly Tomilov21-Mar-05 6:44
Vitaly Tomilov21-Mar-05 6:44 
GeneralPlease Help Pin
Rassul Yunussov21-Mar-05 3:41
Rassul Yunussov21-Mar-05 3:41 
GeneralToolTip Close button Pin
Gurra_Koo21-Mar-05 3:20
Gurra_Koo21-Mar-05 3:20 
GeneralSerial comms Pin
Karl Lloyd21-Mar-05 3:05
Karl Lloyd21-Mar-05 3:05 
GeneralBorder size Pin
caykahve21-Mar-05 2:35
caykahve21-Mar-05 2:35 
GeneralRe: Border size Pin
Ravi Bhavnani21-Mar-05 3:46
professionalRavi Bhavnani21-Mar-05 3:46 
GeneralRe: Border size Pin
caykahve22-Mar-05 7:34
caykahve22-Mar-05 7:34 
GeneralRe: Border size Pin
Vitaly Tomilov21-Mar-05 6:47
Vitaly Tomilov21-Mar-05 6:47 
Generalload ttf file and use it Pin
JabraJabra21-Mar-05 2:16
JabraJabra21-Mar-05 2:16 
GeneralRe: load ttf file and use it Pin
Chris Losinger21-Mar-05 8:59
professionalChris Losinger21-Mar-05 8:59 
GeneralAllocating Memory in a Static Library Pin
Joel Holdsworth21-Mar-05 1:53
Joel Holdsworth21-Mar-05 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.