[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

C++ App to Run in DOS and Launch Another App

tempnode

10/20/2008 4:58:00 PM

I have a problem that I can't seem to solve:

I need to write a C++ app that will run off of a floppy.
Basically, I will boot into DOS (from a floppy), and run my
executable
from the floppy. The executable will crunch some data and then
launch
another application.


How can I launch the other application?


I've tried system(), but it needs a specific path, which isn't viable
in DOS mode. The two apps will be in the same directory, so
basically
this is the process:


CrunchData();
LaunchApp();


How could I launch the other app? I don't think ShellExecute() or the
Process class will work since this will be running in DOS, but I may
be wrong.



Thanks so much.
7 Answers

Victor Bazarov

10/20/2008 5:34:00 PM

0

tempnode@gmail.com wrote:
> [..]
> How could I launch the other app? I don't think ShellExecute() or the
> Process class will work since this will be running in DOS, but I may
> be wrong.

You're asking something specific to your platform, not to the language.
Please consider asking in the newsgroup that deals with your OS.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

tempnode

10/20/2008 6:06:00 PM

0

On Oct 20, 1:34 pm, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
> tempn...@gmail.com wrote:
> > [..]
> > How could I launch the other app?  I don't think ShellExecute() or the
> > Process class will work since this will be running in DOS, but I may
> > be wrong.
>
> You're asking something specific to your platform, not to the language.
>   Please consider asking in the newsgroup that deals with your OS.


Well, actually, the question is specific to both the platform and the
language. This board has more members than does the DOS board, so I
figured I would get more responses and quicker feedback.

Since my question IS focused on C++, it does belong here; and anal
replies like yours are vain, elitist, and unnecessary. If you don't
want to help me, then don't. I asked for some help nicely, and you
proceeded to flex your internet forum muscle by redirecting me when my
question was quite relevant.


If anyone else can help me, I would really appreciate it.


Thanks

Ian Collins

10/20/2008 6:43:00 PM

0

tempnode@gmail.com wrote:
> On Oct 20, 1:34 pm, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
>> tempn...@gmail.com wrote:
>>> [..]
>>> How could I launch the other app? I don't think ShellExecute() or the
>>> Process class will work since this will be running in DOS, but I may
>>> be wrong.
>> You're asking something specific to your platform, not to the language.
>> Please consider asking in the newsgroup that deals with your OS.
>
>
> Well, actually, the question is specific to both the platform and the
> language. This board has more members than does the DOS board, so I
> figured I would get more responses and quicker feedback.
>
> Since my question IS focused on C++,

OK, what is your C++ language question?

--
Ian Collins

tempnode

10/20/2008 6:59:00 PM

0


how can i launch another executable without using system() or the
Process class? It needs to work in DOS.

Ian Collins

10/20/2008 7:08:00 PM

0

[context?]

tempnode@gmail.com wrote:
> how can i launch another executable without using system() or the
> Process class? It needs to work in DOS.

That's a DOS question, not a C++ language one.

The C++ answer would be to use system(). The standard language doesn't
provide any other means of launching an executable.

--
Ian Collins

Erik Wikström

10/20/2008 8:24:00 PM

0

On 2008-10-20 21:08, Ian Collins wrote:
> [context?]
>
> tempnode@gmail.com wrote:
>> how can i launch another executable without using system() or the
>> Process class? It needs to work in DOS.
>
> That's a DOS question, not a C++ language one.
>
> The C++ answer would be to use system(). The standard language doesn't
> provide any other means of launching an executable.


To clarify a bit why this is not a C++ question it should be mentioned
that system() invokes platform-dependent behaviour, so questions about
how to use system() should be directed to a group discussing the platform.

--
Erik Wikström

AnonMail2005@gmail.com

10/21/2008 7:47:00 PM

0

On Oct 20, 12:58 pm, tempn...@gmail.com wrote:
> I have a problem that I can't seem to solve:
>
> I need to write a C++ app that will run off of a floppy.
> Basically, I will boot into DOS (from a floppy), and run my
> executable
> from the floppy.  The executable will crunch some data and then
> launch
> another application.
>
> How can I launch the other application?
>
> I've tried system(), but it needs a specific path, which isn't viable
> in DOS mode.  The two apps will be in the same directory, so
> basically
> this is the process:
>
> CrunchData();
> LaunchApp();
>
> How could I launch the other app?  I don't think ShellExecute() or the
> Process class will work since this will be running in DOS, but I may
> be wrong.
>
> Thanks so much.

Just use a .bat file to run your apps. This way, you can set up the
PATH variable *before* you launch your first app. But if you use a
..bat file, you can just launch your first app, and then depending on
it's return code, launch your second app and there will be no need
for the first app to launch the second app (or any need to set the
path). .bat files are the lowest common denominator "shell" for
windows/DOS apps.

HTH