Solved

Execute a Application from  a C program

Posted on 2003-11-13
5
271 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
5 Comments
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 50 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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9738751
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 50 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
why "." vs "->" 23 120
distributed computing in Python 4 137
Acrinis True image 2 93
If a cell in a range equals "YES" return specific Test. 4 37
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

820 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