home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1430 < prev    next >
Encoding:
Text File  |  1992-08-21  |  1.7 KB  |  38 lines

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