View Single Post
Old 12-19-2008, 10:05 AM   #1
joana.estafanell
Junior Member
joana.estafanell began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2008
Device: iLiad
Problem Launching ipdf from other app

Hi all,

I'm launching the ipdf through a C application, let's call it "A", to show a .pdf document, but when I try to come back to the application "A" pushing the top left button, the iLiad refreshes the screen and displays the .pdf document again, getting impossible to come back to "A".

I paste here the code snippet where I call the ipdf to open a document:

int openPdf ()
{
pid_t childpid; /* variable to store the child's pid */
int status; /* parent process: child's exit status */

flush ();

/* now create new process */
childpid = fork();

if (childpid >= 0) /* fork succeeded */
{
if (childpid == 0) /* fork() returns 0 to the child process */
{
printf("CHILD: I am the child process!\n");
printf("CHILD: Here's my PID: %d\n", getpid());
printf("CHILD: My parent's PID is: %d\n", getppid());
printf("CHILD: The value of my copy of childpid is: %d\n", childpid);
printf("CHILD: Enter an exit value (0 to 255): ");

execlp ("/usr/bin/ipdf", "/usr/bin/ipdf", "/mnt/free/books/test/test.pdf");

flush ();

printf("CHILD: Goodbye!\n");
return 0;
}
else /* fork() returns new pid to the parent process */
{
printf("PARENT: I am the parent process!\n");
printf("PARENT: Here's my PID: %d\n", getpid());
printf("PARENT: The value of my copy of childpid is %d\n", childpid);
printf("PARENT: I will now wait for my child to exit.\n");

flush ();
wait(&status); /*wait for child to exit, and store its status*/
}
}
else /* fork returns -1 on failure */
{
perror("fork"); /* display error message */
return 0;
}

flush ();
}

Can anyone help me with this? Is there any other way to call to another application inside the iLiad different to 'fork' or using the manager process of iliad ??

Thanks!!

joana.

joana.estafanell is offline   Reply With Quote