VB 5 question about dos application

  • Thread starter Pierre Hinse CET
  • Start date

Thread Starter

Pierre Hinse CET

Hi List,
I have an application that controls an x-ray analyzer through a legacy MS-DOS Application.
Everything works fine until the user close my VB application, the child MS-DOS application won't close.

It shows up in the task list with the "Winoldap" name, and prevents the VB application from re-connecting to the analyzer.

If the operator goes into the win95 task list and presses the "End task" button then another window comes up "Unable to end task", and then the "End task" button works.

Can I put some code in my VB application to ensure this MS-Dos child process is closed properly.

Pierre R. Hinse CET My opinions are my own.
BESTECH Engineering Business mailto:[email protected]
tel:705 675 7720x203 Personal mailto:[email protected]
fax:705 675 5507 http://www.bestech.com

Johan Bengtsson P&L Automatik AB

Is there any "nice" way of closing the MS-DOS application (like pressing a certain key or something). What you describe sounds like "stop that application by not letting it do anything
including save, nice exit, or anything - ie just kill it" It is generally better if an applicaton closes itself and then the MS-DOS-box will disappear by itself.

You culd perhaps send a (series of) windows message(s) containing the necesary keystroke(s) and then just wait for it to exit.

/Johan Bengtsson

P&L, the Academy of Automation
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
Johan is definately right that if the application can be shutdown nicely then this is the route to take.

However, if a forced shutdown is really all that is needed then a lot can usually be achieved by creating a shortcut to the MSDOS program and setting its properties to allow Windows to shut it down forcefully without it caring. After creating the shortcut, look at its properties. Make sure that in the Program tab, "Close on exit" is checked; also (more importantly) in the Misc tab that "Termination: Warn If Still Active" is not checked.

Without knowing the DOS or VB app which is running it I don't know if this will be enough, but give it a go.

Mark Rogers, Product Manager
Citect (UK) Ltd, Peterborough, England
But, how can I program to create a shortcut to the MSDOS program and set its properties to allow Windows to shut it down forcefully without it caring.