home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!psgrain!ee.und.ac.za!ucthpx!casper.cs.uct.ac.za!jholdern
- From: jholdern@casper.cs.uct.ac.za (J E Holderness)
- Subject: How to spawn a DOS program in BC++?
- Message-ID: <BtC46w.52G@casper.cs.uct.ac.za>
- Keywords: spawn
- Organization: Computer Science Department, University of Cape Town
- Date: Fri, 21 Aug 1992 13:01:44 GMT
- Lines: 27
-
- I'm writing a program that needs to spawn a DOS program from within
- Windows. My first problem was that I don't want it to be visible while it
- is executing. The solution was to use a PIF file, but it is only know at
- run-time what the program name is, so I have to make a temporary PIF file
- at run-time and then execute that. Is there a better way of doing this?
-
- My next problem was that once I had started the program running (I'm using
- WinExec btw), control was returned to my application, leaving the DOS
- program running in the background which is not what I want. My solution was
- to store the number of tasks being executed before I did the WinExec, and
- then wait until the number of tasks reached that value again. To stop
- everything else coming to a halt while I was waiting, I kept executing the
- Yield function. Once again, is there a better way of doing this?
-
- My last problem, is that while I'm doing this, I want to change the mouse
- cursor to the hourglass thingy. The only way I can get it to stay like
- that (it changes to something else when it leaves my Window), is to keep
- setting it in my waiting loop. Any other solutions?
-
- Btw, I'm using Borland C++ 3.0.
- I'm also very new to Windows and C++ programming, so please forgive if
- these are stupid questions. Any help would be appreciated.
-
- Thanks
- James
-
-
-