Board index » cppbuilder » Run application within an application

Run application within an application

I am trying to start the Calculator App from a cppbuilder application when
the user select a menu item. I am using the command :

        system ("c:\\winnt\\system32\\cal.exe") ;

The calucator will run, but also DOS window pop up on the desktop !

Anyidea ...Thanks

 

Re:Run application within an application


Quote
bmasri wrote:
> I am trying to start the Calculator App from a cppbuilder application when
> the user select a menu item. I am using the command :

>         system ("c:\\winnt\\system32\\cal.exe") ;

> The calucator will run, but also DOS window pop up on the desktop !

> Anyidea ...Thanks

    Hi bmasri,

  I am still using :
      WinExec (  "c:\\winnt\\system32\\cal.exe" , SW_SHOW );

  It's old but good enough.
  Greetings
                        Boian

Re:Run application within an application


The function system()starts a DOS box which then issues the
"C:\\...\\cal.exe"
command which causes the calculator program to run.

To cut out the middle man, use either WinExec() or,
in a 32-bit world, CreateProcess().

See online help for details.

Mike

bmasri <bma...@densolabs.com> wrote in article
<01bcefbc$a7795c90$090a11ac@bmasri>...

Quote
> I am trying to start the Calculator App from a cppbuilder application
when
> the user select a menu item. I am using the command :

>    system ("c:\\winnt\\system32\\cal.exe") ;

> The calucator will run, but also DOS window pop up on the desktop !

> Anyidea ...Thanks

Re:Run application within an application


Oh, I can't resist:

Quote
> I am trying to start the Calculator App from a cppbuilder application when
> the user select a menu item. I am using the command :
>         system ("c:\\winnt\\system32\\cal.exe") ;
> The calucator will run, but also DOS window pop up on the desktop !

As others have suggested, use WinExec.  As I often suggest, don't use
the backslashes - use forward slashes.  If you get into that habit,
you'll never have to remember to use double \.  Like thus:

WinExec( "c:/winnt/system32/cal.exe", SW_SHOW );

+===================================================+
| Jonathan Arnold (mailto:jdarn...@world.std.com)   |
| Programmer                Roger Wagner Publishing |
| http://world.std.com/~jdarnold                    |
+===================================================+

Re:Run application within an application


Quote
Mike Ovenden wrote:

> The function system()starts a DOS box which then issues the
> "C:\\...\\cal.exe"
> command which causes the calculator program to run.

> To cut out the middle man, use either WinExec() or,
> in a 32-bit world, CreateProcess().

I would, for such a simple task, recommend ShellExecute(...) since it
doesn't need the 'parameter overdose' CreateProcess(...) needs.

J?rg

Re:Run application within an application


On 13 Nov 1997 09:10:58 GMT, "Mike Ovenden" <mike.oven...@macro4.com>
wrote:

Quote
>The function system()starts a DOS box which then issues the
>"C:\\...\\cal.exe"
>command which causes the calculator program to run.

>To cut out the middle man, use either WinExec() or,
>in a 32-bit world, CreateProcess().

or ShellExecute()
Ken Moffat
kmof...@halcyon.com

Other Threads