Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Richard MacCutchan1-Aug-13 21:11
mveRichard MacCutchan1-Aug-13 21:11 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
shanmugarajaa1-Aug-13 22:12
shanmugarajaa1-Aug-13 22:12 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Richard MacCutchan1-Aug-13 22:27
mveRichard MacCutchan1-Aug-13 22:27 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
shanmugarajaa1-Aug-13 22:48
shanmugarajaa1-Aug-13 22:48 
GeneralMessage Closed Pin
2-Aug-13 2:43
Erudite_Eric2-Aug-13 2:43 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Richard MacCutchan2-Aug-13 3:04
mveRichard MacCutchan2-Aug-13 3:04 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
NotPolitcallyCorrect2-Aug-13 3:18
NotPolitcallyCorrect2-Aug-13 3:18 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Richard MacCutchan2-Aug-13 4:14
mveRichard MacCutchan2-Aug-13 4:14 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Erudite_Eric2-Aug-13 5:05
Erudite_Eric2-Aug-13 5:05 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Erudite_Eric2-Aug-13 5:04
Erudite_Eric2-Aug-13 5:04 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
NotPolitcallyCorrect2-Aug-13 5:27
NotPolitcallyCorrect2-Aug-13 5:27 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
shanmugarajaa3-Aug-13 3:32
shanmugarajaa3-Aug-13 3:32 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Richard MacCutchan6-Aug-13 4:45
mveRichard MacCutchan6-Aug-13 4:45 
GeneralMessage Automatically Put Back Pin
Erudite_Eric6-Aug-13 4:33
Erudite_Eric6-Aug-13 4:33 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Rolf Kristensen3-Aug-13 1:01
Rolf Kristensen3-Aug-13 1:01 
AnswerRe: How to store and retrieve data from database via internet using VC++2008 Pin
jschell2-Aug-13 14:26
jschell2-Aug-13 14:26 
QuestionDevice context and dimensions Pin
Argonia1-Aug-13 4:54
professionalArgonia1-Aug-13 4:54 
QuestionHooking a running process 's Innermost dll's function Pin
dileep Perumbavoor1-Aug-13 1:26
dileep Perumbavoor1-Aug-13 1:26 
AnswerRe: Hooking a running process 's Innermost dll's function Pin
Erudite_Eric1-Aug-13 1:34
Erudite_Eric1-Aug-13 1:34 
AnswerRe: Hooking a running process 's Innermost dll's function Pin
pasztorpisti1-Aug-13 1:40
pasztorpisti1-Aug-13 1:40 
AnswerRe: Hooking a running process 's Innermost dll's function Pin
Santhosh G_3-Aug-13 23:30
Santhosh G_3-Aug-13 23:30 
QuestionSaving console output to .txt/.html file using C++/VC++ Pin
pk jain31-Jul-13 3:30
pk jain31-Jul-13 3:30 
AnswerRe: Saving console output to .txt/.html file using C++/VC++ Pin
Richard MacCutchan31-Jul-13 3:58
mveRichard MacCutchan31-Jul-13 3:58 
AnswerRe: Saving console output to .txt/.html file using C++/VC++ Pin
pasztorpisti31-Jul-13 4:25
pasztorpisti31-Jul-13 4:25 
You can solve this in two different ways: Inside your program or outside your program. The "outside" solution is probably simpler and more roboust and easier to implement.

Outside:
When you are running your program you redirect its output to another program that does the following: prints the incoming data to the console but at the same time it writes it into a text file and of course at the same time it can do other things too with the log data. You can do the redirection either by writing another program that runs the test with redirected input/output or you can choose an easier solution, piping together programs with the help of your cmd or bash:
Example python script that prints the input to console and logs to file at the same time:
file: x.py
import sys
with open('logfile.txt', 'w') as log_file:
    while 1:
        s = sys.stdin.readline()
        if not s:
            break
        sys.stdout.write(s)
        log_file.write(s)
        log_file.flush()

Commandline usage:
C++
TestProgram | python x.py

Of course this program could be anything, not only a python script but a perl script or a c/C++ program or a java program.

Inside:
If you want to solve the problem inside your test program then create your own logger and log through that instead of using printf() or similar methods. In your logger you can create many outputs so when your test program logs something your logger can direct it towards different outputs for example a console writer output, a html writer output and a text file writer output.

Almost forgot to mention: If you are on linux or you have cygwin on windows then you can use the tee command that does basically the same as the above python script.

modified 31-Jul-13 12:13pm.

QuestionCString to float conversion Pin
tagopi31-Jul-13 0:32
tagopi31-Jul-13 0:32 

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.