Re: Q:show output from script
From: Thomas Matthews (Thomas_MatthewsSpamBotsSuck_at_sbcglobal.net)
Date: 01/09/05
- Next message: Mike Wahler: "Re: calling virtual function results in calling function of base class ..."
- Previous message: Thomas Matthews: "Re: how to complile cgal by borland c++ build"
- In reply to: R. Stormo: "Q:show output from script"
- Next in thread: R. Stormo: "Re: Q:show output from script"
- Reply: R. Stormo: "Re: Q:show output from script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 09 Jan 2005 18:48:59 GMT
R. Stormo wrote:
> I have a problem showing output that is comming from a script.
> If I make a script running at commandline it do work and everything
> are showing.
> But when I try to execute it from within my proggy it would not show.
> I have tried to save the outout to a file and again, when I runit from
> commandline it do save everything but from software it would not.
> It do only show things that are outputed with "echo"
>
> My routine for showing the file are, the execute script rutine are the same.
>
> FILE *fp; //The filePIPE
> char message[1024]; //Declare buffer to hold the file
What happens if the file is bigger than 1024 bytes?
> fp = fopen( myfilename, "r" );//Read read in txt mode
> if ( fp==NULL )
> msgbox("could not open file to read !!!", "Warning");//Show File not
> found!
> else
> {
> while( !feof( fp ) ) //check for EOF
> {
> fgets( line, 128, fp ); //Read 128 bytes
> strcat( message, line ); //Add this line to previous buffer
You should be checking the total bytes read to make sure
you don't overflow the buffer.
> }
> fclose(fp); //Close the filePIPE
> //------------------------------
> // Show the output in a dialogbox on screen
> //------------------------------
> eMessageBox msg(message, "OUTPUT", eMessageBox::iconInfo
> eMessageBox::btOK);
> msg.show(); msg.exec(); msg.hide();
>
> }
>
>
>
> In advance, thanks
This looks like a platform / operating system issue.
Many windowing operating systems do not support the
mixing of scripts and windowing. Does yours?
Perhaps you should ask about this on a newsgroup
dedicated to your platform.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
- Next message: Mike Wahler: "Re: calling virtual function results in calling function of base class ..."
- Previous message: Thomas Matthews: "Re: how to complile cgal by borland c++ build"
- In reply to: R. Stormo: "Q:show output from script"
- Next in thread: R. Stormo: "Re: Q:show output from script"
- Reply: R. Stormo: "Re: Q:show output from script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|