Solved

Execute a Application from  a C program

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

743 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

10 Experts available now in Live!

Get 1:1 Help Now