Hi all,

I have and external mySQL C API program which needs to receive the data to search for in the database.

The following code displays the connection to the Qprocess and it works fine
Qt Code:
  1. void DatabaseLogin::connectAccept()
  2. {
  3.  
  4. proc = new QProcess( this );
  5. QLabel *label = new QLabel("tester",0);
  6. label->show();
  7.  
  8. QDir *directoryPath = new QDir("f:/projek/Functional_units/Database_sources/files");
  9.  
  10. proc->setWorkingDirectory(*directoryPath);
  11. // Set up the command and arguments.
  12. proc->addArgument( "cmd" );
  13. proc->addArgument( "/c" );
  14. proc->addArgument( "fdatabase" );
  15. proc->addArgument( "epr" );
  16.  
  17. proc->start();
  18.  
  19. connect( proc, SIGNAL(readyReadStdout()),
  20. this, SLOT(readFromStdout()) );
  21.  
  22. if ( !proc->start() )
  23. {
  24. // error handling
  25. QMessageBox::critical( 0,
  26. tr("Fatal error"),
  27. tr("Could not start the program."),
  28. tr("Quit") );
  29. exit( -1 );
  30. }
  31. }
  32.  
  33. void DatabaseLogin::readFromStdout()
  34. {
  35. // Read and process the data.
  36. // Bear in mind that the data might be output in chunks.
  37. output->append( proc->readStdout() );
  38. }
To copy to clipboard, switch view to plain text mode 

please note that ouput is just the verify the results obtained, so the program is called fdatabase and one of the variables are the database called epr. I can't send the field to look for using the above method because the API run differently to another program.

In the API I have scanf and thus from the QT3 I want to write to stdIn any advise/questions? When I add
Qt Code:
  1. proc->writeToStdin("1123");
To copy to clipboard, switch view to plain text mode 
just after the start nothing wants to work

Please help!
Thanks