Click here to Skip to main content
15,917,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: About Memory utilization Pin
Peter Weyzen14-Nov-07 18:18
Peter Weyzen14-Nov-07 18:18 
QuestionADO, how to group by record count, and get the first of every group Pin
followait13-Nov-07 16:05
followait13-Nov-07 16:05 
Questioncode to walk down all a program's windows Pin
Lowell Boggs13-Nov-07 12:28
Lowell Boggs13-Nov-07 12:28 
AnswerRe: code to walk down all a program's windows Pin
User 58385213-Nov-07 15:35
User 58385213-Nov-07 15:35 
AnswerRe: code to walk down all a program's windows Pin
Hamid_RT13-Nov-07 18:45
Hamid_RT13-Nov-07 18:45 
AnswerRe: code to walk down all a program's windows Pin
Lowell Boggs14-Nov-07 5:07
Lowell Boggs14-Nov-07 5:07 
GeneralRe: code to walk down all a program's windows Pin
Peter Weyzen14-Nov-07 18:21
Peter Weyzen14-Nov-07 18:21 
QuestionFOPEN Redirection Pin
User 42081113-Nov-07 10:20
User 42081113-Nov-07 10:20 
I've got a piece of software written by someone in my department years ago. (IE, I have no access to the source nor do I have a developer I can contact.) The problem is that this piece of software outputs information to a log.txt file that I would like to read in real time (in a console window) because when the program crashes the file stream gets closed before it can write its buffer to the actual file leaving me with 0kb log files, awesome.

My initial thought on how to do this is to first inject my own .dll in to the program (using InjLib). I could then use my own .dll to redirect any calls to CreateFile where the filename is log.txt to a new file stream. I thought at first I could just pass back a pointer to stdout, this obviously resulted in whatever was going to log.txt to write to the console window that the program already has open. This might work if the program wasn't already dumping alot of info. to that console. So I thought maybe I could create a second console window. Knowing that each .exe file can only have 1 open console I searched around code project and found a multiple console opening program that uses pipes. Here is where I am stuck. I know that fprintf writes to a buffer. The only way my 2nd console gets updated is when the original program closes the file stream. I've tried created a pipe with no buffer and hardware write through but to no avail.

I guess my question is: Is there a simpler way of redirecting a file stream to console window? Or, if not, is there some way for me to read from the buffer fprintf uses? I've tried using PeekPipe on my pipe but it doesn't see anything.

I'm not exactly sure what code snippets would help in my explanation.

modified 28-Aug-18 21:01pm.

AnswerRe: FOPEN Redirection Pin
Chris Meech13-Nov-07 11:15
Chris Meech13-Nov-07 11:15 
GeneralRe: FOPEN Redirection Pin
User 42081113-Nov-07 12:00
User 42081113-Nov-07 12:00 
AnswerRe: FOPEN Redirection Pin
Bram van Kampen13-Nov-07 13:22
Bram van Kampen13-Nov-07 13:22 
AnswerRe: FOPEN Redirection [modified] Pin
Jude Deng13-Nov-07 15:25
Jude Deng13-Nov-07 15:25 
GeneralRe: FOPEN Redirection Pin
User 42081114-Nov-07 3:53
User 42081114-Nov-07 3:53 
GeneralRe: FOPEN Redirection Pin
Jude Deng2-Feb-08 14:43
Jude Deng2-Feb-08 14:43 
Questiona little help with an idea ?[modified] Pin
steve2028613-Nov-07 9:10
steve2028613-Nov-07 9:10 
AnswerRe: a little help? with an idea Pin
Maximilien13-Nov-07 9:36
Maximilien13-Nov-07 9:36 
GeneralRe: a little help? with an idea [modified] Pin
steve2028614-Nov-07 8:14
steve2028614-Nov-07 8:14 
QuestionPseudoRandom functions in C++ Pin
bigdenny20013-Nov-07 7:32
bigdenny20013-Nov-07 7:32 
AnswerRe: PseudoRandom functions in C++ Pin
jhwurmbach13-Nov-07 7:54
jhwurmbach13-Nov-07 7:54 
AnswerRe: PseudoRandom functions in C++ Pin
Nathan Addy13-Nov-07 8:39
Nathan Addy13-Nov-07 8:39 
GeneralRe: PseudoRandom functions in C++ Pin
bigdenny20013-Nov-07 8:59
bigdenny20013-Nov-07 8:59 
GeneralRe: PseudoRandom functions in C++ Pin
Nelek13-Nov-07 22:28
protectorNelek13-Nov-07 22:28 
AnswerRe: PseudoRandom functions in C++ Pin
cp987613-Nov-07 10:05
cp987613-Nov-07 10:05 
QuestionProblem during running multiple instance of an MFC application Pin
Chirag_kalra13-Nov-07 7:30
Chirag_kalra13-Nov-07 7:30 
AnswerRe: Problem during running multiple instance of an MFC application Pin
Bram van Kampen13-Nov-07 13:41
Bram van Kampen13-Nov-07 13:41 

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.