Solved

Execute a Application from  a C program

Posted on 2003-11-13
5
266 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

Why are Office 365 signatures so complicated?

Trying to setup transport rules for Office 365 email signatures and can’t quite figure it out? Having to test the signature over and over? Make things simple by using Exclaimer Cloud - Signatures for Office 365.

Question has a verified solution.

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

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…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

943 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now