Results 1 to 2 of 2

Thread: readStdout ( plz help needed urgently)

  1. #1
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default readStdout ( plz help needed urgently)

    hey i am stuck with this prob plz tell me what is the prob.
    this is a c file
    #include<stdio.h>
    main()
    {
    FILE *fp;
    fp=fopen("hello","w");
    fprintf(fp,"%s","hello");
    fclose(fp);
    printf("hello");
    }
    now i have generated a executable like $gcc hello.c -o myexec

    now there is a form and a button called run
    now i have done some thing like this in the slot run
    QProcess *proc=new QProcess(0);
    proc->addArgument("/home/shrikar/myexec");
    if(!proc->start())
    {
    // error message
    }
    else
    {
    QString *str=(QString*)proc->readLineStdout( );
    // now if i print this its not giving any out put neither it is writing anything to the file hello
    }

    now my second question is what if the executable is a image like a mandelbrot set.

    plz help me (urgent)

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: readStdout ( plz help needed urgently)

    a life without programming is like an empty bottle

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.