?
Solved

Execute a Application from  a C program

Posted on 2003-11-13
5
Medium Priority
?
278 Views
Last Modified: 2010-04-15
HI

I have a requirement of executing a internet explorer from a C program with a BMP name as parameter.
can you please let me know the function call to do that.

Thanks

0
Comment
Question by:s_syed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 200 total points
ID: 9738740
Hi s_syed,

use system("path_to_explorer...");

system is used to launch programs from a C program

Cheers!
Sunny:o)
0
 

Author Comment

by:s_syed
ID: 9738864
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
char command[] = "L:\\program files\\Internet Explorer\\iexplore.exe x:\\paradise.jpg";
int main()
{
      cout << "Inside main" << endl;
      
      system(command);
      return 0;
}

i tried like that and got an error as

Inside main
'L:\program' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue

0
 
LVL 6

Accepted Solution

by:
Ajar earned 200 total points
ID: 9738924
solution :

instead of

>>char command[] = "L:\\program files\\Internet Explorer\\iexplore.exe x:\\paradise.jpg";

use

>> char command[] = "\"L:\\program files\\Internet Explorer\\iexplore.exe\" x:\\paradise.jpg";
0
 

Expert Comment

by:rita_512
ID: 9758460
or else u cud use

char command[]="C:\\PROGRA~1\\INTERN~1\\IEXPLORE.EXE C:\\test.jpg";

shud work as fine.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question