How to execute a 16-bit or DOS application in a 32-bit program?
I have a third party 16-bit/DOS application which runs fine in the DOS console under Win98. When using the system() or ShellExecute() to execute the third party app in my 32-bit program, an error "This program has performed an illegal operation and will be shutdown" occurred.
How should I make such a call for a 16-bit or DOS app?
I don't what is causing this problem, but try CreateProcess instead of ShellExecute.
You can create a console application (perhaps this is what you mean by a DOS project) with any version of VC: File->New->Projects tab->Win32 Console Application.
To create a 16 bit console application you need VC 1.52 (used to come with VC 5/6 I believe).
My intention is to create an exe which can run upon system bootup using a bootable media. So i thought the exe need to be a DOS program running under RAM disk.
Re: How to execute a 16-bit or DOS application in a 32-bit program?
Originally posted by Kurosan
I have a third party 16-bit/DOS application which runs fine in the DOS console under Win98. When using the system() or ShellExecute() to execute the third party app in my 32-bit program
This should work. There must be another reason it is not working.
Originally posted by Kurosan
My intention is to create an exe which can run upon system bootup using a bootable media. So i thought the exe need to be a DOS program running under RAM disk.
What? I am very confused. You say you want to execute a 16-bit application from a 32-bit application and then you say you want to execute the 16-bit application "upon system bootup using a bootable media". Which do you want to do?
The bootup problem is more of a legal one than a technical one. If you distribute a bootable copy of DOS then you are likely to have Microsoft chasing after you. So you need to find a legal solution.
If the reason you intend to make the non-bootable version also be 16-bit is because you want to have one program, then the requirements for the non-bootable version is dependent on the solution you use for the bootable version. You might not be able to have a common "binary" (compiled) version. You might need to make the two versions compatible only at the source code level.
I think you must first determine what is legally available for making a bootable disk.
Bookmarks