Click here to Skip to main content
15,920,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCrossWord puzzle alogrithm Pin
Mohsen Saad15-Mar-05 18:02
Mohsen Saad15-Mar-05 18:02 
GeneralRe: CrossWord puzzle alogrithm Pin
Ravi Bhavnani16-Mar-05 3:39
professionalRavi Bhavnani16-Mar-05 3:39 
GeneralTHE USE OF "cout statement inside the for loop" Pin
phijophlip15-Mar-05 17:56
phijophlip15-Mar-05 17:56 
GeneralRe: THE USE OF "cout statement inside the for loop" Pin
Serge Krynine15-Mar-05 18:54
Serge Krynine15-Mar-05 18:54 
GeneralRe: THE USE OF "cout statement inside the for loop" Pin
namaskaaram15-Mar-05 18:59
namaskaaram15-Mar-05 18:59 
General(modified) THE USE OF "cout statement inside the for loop" Pin
normanS15-Mar-05 19:12
normanS15-Mar-05 19:12 
GeneralRe: THE USE OF "cout statement inside the for loop" Pin
David Crow16-Mar-05 3:09
David Crow16-Mar-05 3:09 
GeneralNeed Help for writing event log with more than one parameter Pin
Amy Yang15-Mar-05 17:41
Amy Yang15-Mar-05 17:41 
Hi, there,


I created Message Text File and one of the messages has 4 parameters.
MessageId = 0x1000
Facility = Application
Severity = Informational
SymbolicName = MSG_NORMAL


Language = English


%1 %2 %3 %4
.


Then I use FormatMessage function to retrive the message by ID and
pass the parameters in. But I can't get the string I want.


DWORD_PTR args[4] = { (DWORD_PTR)(&string1),
(DWORD_PTR)(&string2),
(DWORD_PTR)(&string3),
(DWORD_PTR)(&string4)};


// Retrieve the English message string.
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_HMODULE |
FORMAT_MESSAGE_ARGUMENT_ARRAY,
ghResDll,
EVENT_MSG_SESSION_NORMAL,
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
(LPTSTR) &lpMsgBuf3,
2048,
(va_list*)(&args));


Then
evtLog->LogIt( EVENTLOG_INFORMATION_TYPE, 1,
EVENT_MSG_SESSION_NORMAL, pMsg3, 1 );


So in event log is %2 %3 %4


Can anyone tell me where is wrong with my code? Thanks In Advance.



GeneralRe: Need Help for writing event log with more than one parameter Pin
David Crow16-Mar-05 3:28
David Crow16-Mar-05 3:28 
GeneralRe: Need Help for writing event log with more than one parameter Pin
Amy Yang16-Mar-05 3:49
Amy Yang16-Mar-05 3:49 
GeneralRe: Need Help for writing event log with more than one parameter Pin
David Crow16-Mar-05 3:57
David Crow16-Mar-05 3:57 
GeneralRe: Need Help for writing event log with more than one parameter Pin
cmk16-Mar-05 16:45
cmk16-Mar-05 16:45 
GeneralRe: Need Help for writing event log with more than one parameter Pin
Amy Yang16-Mar-05 17:54
Amy Yang16-Mar-05 17:54 
GeneralMax Range For Some Constants Pin
IceBerG7115-Mar-05 16:02
IceBerG7115-Mar-05 16:02 
GeneralRe: Max Range For Some Constants Pin
Serge Krynine15-Mar-05 16:22
Serge Krynine15-Mar-05 16:22 
GeneralAbort capture screen Pin
Jack.Fu15-Mar-05 15:06
Jack.Fu15-Mar-05 15:06 
GeneralRe: Abort capture screen Pin
Christian Graus15-Mar-05 15:21
protectorChristian Graus15-Mar-05 15:21 
GeneralRe: Abort capture screen Pin
FlyingTinman15-Mar-05 15:53
FlyingTinman15-Mar-05 15:53 
GeneralRe: Abort capture screen Pin
Member 161799927-May-05 7:13
Member 161799927-May-05 7:13 
GeneralRe: Abort capture screen Pin
FlyingTinman27-May-05 8:18
FlyingTinman27-May-05 8:18 
QuestionHow to get a pixel's RGB value. Pin
Francis Chau15-Mar-05 14:41
Francis Chau15-Mar-05 14:41 
AnswerRe: How to get a pixel's RGB value. Pin
Christian Graus15-Mar-05 15:02
protectorChristian Graus15-Mar-05 15:02 
GeneralRe: How to get a pixel's RGB value. Pin
Francis Chau15-Mar-05 15:35
Francis Chau15-Mar-05 15:35 
GeneralRe: How to get a pixel's RGB value. Pin
FlyingTinman15-Mar-05 16:28
FlyingTinman15-Mar-05 16:28 
GeneralRe: How to get a pixel's RGB value. Pin
ThatsAlok15-Mar-05 18:18
ThatsAlok15-Mar-05 18:18 

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.