User forums > Using Code::Blocks

Redirect std::cout

<< < (2/3) > >>

LordCB:
hmmm it is very nice that you give me a

TRANSLATION my friend.

I am a person who discuss or ask every possibility which grows up my horizon in using C::B.

Yes I am a newbie and I have search and read many thing about C::B. (very good IDE I fall down on my knees)--> Translation (   I intended it as a compliment)

But your explanation with your Translation have no good aftertaste for me in my oppinion.....

Grom:
Just take a look here
http://bytes.com/groups/c/132096-redirecting-cout-dialog-window
You can derive a class from streambuf and direct it to a wxMemo class.
 And try that http://osdir.com/ml/lib.wxwindows.general/2004-01/msg01465.html in wx don't know which way is the best, but please give us know about the best way. In fact it is going to be grate to have such rederection component in wxSmith. I did that in some ugly way, such that cout in black and cerr was in red.
Int might be better to try wxStreamToTextRedirector.

LordCB:
Thank you very much to your suggestions I will give it a try asap and a feddback back to here....

dmoore:
a bit of a hack, but OP *might* be able to get his desired redirection in CB using my ShellExtensions plugin. A feature of the plugin allows you to run custom commands that redirect output to a notepage in a CB dockable window.

1. (assuming win32 and recent CB nightly) download a binary for the plugin from: http://developer.berlios.de/project/showfiles.php?group_id=7745&release_id=15437

2. follow installation instructions in the readme

3. then goto Settings -> Environment -> ShellExtensions -> click New

4. then:
* type a name for the command
* the command line (e.g. "mymainprog.exe")
* mode: Windowed console notepage
* menu location: specifies the menu item name e.g. "MyProgram"

5. click OK.

6. The program will then be available from the Extensions menu

LordCB:
Ohh very good,

so I have also a way to do it.
here is my sugegestion.

In my code everywhere where I wish to see an output I put this line:


--- Code: ---std::cout << "Initialiaze Function init() " <<  std::endl;

--- End code ---

or


--- Code: ---std::cout << "Hello now my database is connented" <<  std::endl;

--- End code ---
etc.

after all you build your Project. Then create a user-defined-tool. ;o)
Did you know what is coming ;o)).

Yes take your executable from your builded application and click launch tool hidden with standard output redirected.

after running you see your app and you can click around and every time it occures a std::cout in your code

you see it in your IDE C::B under  Logs & other in the tab Code::blocks.

Any comment??????




Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version