Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call another program without using system()??

Status
Not open for further replies.

Paris1849

Programmer
Mar 22, 2001
7
0
0
US
I want to call Internet Explorer from my application and have it load up with a file called Mainpage.html. The following way is the way that I DO NOT want to use:

system("C:\\PROGRA~1\\INTERN~2\\IEXPLORE.EXE C:\\VC5\\LAUNCHER\\MAINPAGE.HTML");

The problem is no way to calculate 8-character tilda equivalents of long file names. For example, \Internet Explorer\ is \INTERN~2\ on my computer, but it may very well be \INTERN~1\ on someone else's computer. The software that I am writing should be able to run on anyone's computer.
I --KNOW-- there is an easier way to invoke other programs. I see other applications do it all the time. Someone please help!
 
Never mind. I found it. It's called WinExec(). Sorry!
-
Paris, 1849
 
Use ShellExecute function. It is better thant others. With this function you dont need to determine which application will operate, for example if you enter document.doc it will be opened with your default word application

Omer YESIL
Visual C++, SQL, TCP/IP, Delphi, Pascal, Assembler, 3D Studio Max.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top