Click here to Skip to main content
15,892,517 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Get correct Time (Format) Pin
Nelek11-Sep-07 22:44
protectorNelek11-Sep-07 22:44 
Questioni have written my own collection class,some errors Pin
bhogavalli suresh11-Sep-07 19:56
bhogavalli suresh11-Sep-07 19:56 
AnswerRe: i have written my own collection class,some errors Pin
Cedric Moonen11-Sep-07 20:16
Cedric Moonen11-Sep-07 20:16 
AnswerRe: i have written my own collection class,some errors Pin
Hamid_RT11-Sep-07 20:47
Hamid_RT11-Sep-07 20:47 
AnswerRe: i have written my own collection class,some errors Pin
Nelek11-Sep-07 22:48
protectorNelek11-Sep-07 22:48 
AnswerRe: i have written my own collection class,some errors Pin
David Crow12-Sep-07 3:37
David Crow12-Sep-07 3:37 
QuestionGetting hold of certain event entries Pin
Programm3r11-Sep-07 19:46
Programm3r11-Sep-07 19:46 
AnswerRe: Getting hold of certain event entries Pin
carrivick12-Sep-07 8:50
carrivick12-Sep-07 8:50 
The first error lies in the following line

if ((LPSTR)((LPBYTE) pevlr + sizeof(EVENTLOGRECORD))=="Windows Agent")

What you are performing is a pointer comparison with a static string. This is only going to work in two ways

if the expression (LPSTR)((LPBYTE) pevlr + sizeof(EVENTLOGRECORD)) is used to initialise a string class like std::string or CString etc


a more straight forward way is to use a string compariosn function eg strcmp or its wide equivalent if you have a Unicode project.

i.e.

if(strcmnp((LPSTR)((LPBYTE) pevlr + sizeof(EVENTLOGRECORD)),"Windows Agent") == 0)


The other problem you might face is user priveledge as access to a system resource like the event logs may be restricted if you are not an Admin user.
QuestionProblems about how to explore a program's action? Pin
kcynic11-Sep-07 19:34
kcynic11-Sep-07 19:34 
AnswerRe: Problems about how to explore a program's action? Pin
Cedric Moonen11-Sep-07 20:31
Cedric Moonen11-Sep-07 20:31 
GeneralRe: Problems about how to explore a program's action? Pin
kcynic11-Sep-07 21:33
kcynic11-Sep-07 21:33 
AnswerRe: Problems about how to explore a program's action? Pin
Hamid_RT11-Sep-07 20:48
Hamid_RT11-Sep-07 20:48 
GeneralRe: Problems about how to explore a program's action? Pin
kcynic11-Sep-07 21:33
kcynic11-Sep-07 21:33 
AnswerRe: Problems about how to explore a program's action? Pin
carrivick12-Sep-07 8:52
carrivick12-Sep-07 8:52 
Questionhow to upload a file on a server at a perticular location? Pin
AnayKulkarni11-Sep-07 19:14
AnayKulkarni11-Sep-07 19:14 
AnswerRe: how to upload a file on a server at a perticular location? Pin
Jason Teagle11-Sep-07 22:16
Jason Teagle11-Sep-07 22:16 
GeneralRe: how to upload a file on a server at a perticular location? Pin
AnayKulkarni12-Sep-07 0:14
AnayKulkarni12-Sep-07 0:14 
QuestionRe: how to upload a file on a server at a perticular location? Pin
David Crow12-Sep-07 3:40
David Crow12-Sep-07 3:40 
QuestionHow to fixed such error?C2220 Pin
kcynic11-Sep-07 17:38
kcynic11-Sep-07 17:38 
AnswerRe: How to fixed such error?C2220 Pin
Stephen Hewitt11-Sep-07 17:46
Stephen Hewitt11-Sep-07 17:46 
AnswerRe: How to fixed such error?C2220 Pin
David Crow12-Sep-07 3:42
David Crow12-Sep-07 3:42 
QuestionGet and Set methods Pin
User 58385211-Sep-07 16:16
User 58385211-Sep-07 16:16 
AnswerRe: Get and Set methods Pin
George L. Jackson11-Sep-07 18:19
George L. Jackson11-Sep-07 18:19 
AnswerRe: Get and Set methods Pin
Nelek11-Sep-07 22:55
protectorNelek11-Sep-07 22:55 
AnswerRe: Get and Set methods Pin
Mark Salsbery12-Sep-07 8:30
Mark Salsbery12-Sep-07 8:30 

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.