How to execute a 16-bit or DOS application in a 32-bit program?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: How to execute a 16-bit or DOS application in a 32-bit program?

Hybrid View

  1. #1

    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?

    Also can Visual Studio create a real DOS project?

  2. #2
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    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).

  3. #3
    Sorry about that. I made a mistake in my coding.

    Does it mean that Visual Studio can not create a real DOS project?

  4. #4
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    You need Visual C++ 1.52 to create a 16 bit application, which is probably what you mean by a real DOS app.

    Why do you need to do this anyway? Perhaps there is another way round what you are trying to do?

  5. #5
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Originally posted by Kurosan
    Does it mean that Visual Studio can not create a real DOS project?
    Not with the newer versions of the studio...as mentioned you need version 1.52...
    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds


    Article(s): Allocators (STL) Function Objects (STL)

  6. #6
    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.

    Any suggestion?

  7. #7
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266

    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.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  8. #8
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    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?
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  9. #9
    Sorry for the confusion.
    I need to have two versions, one to run upon bootup (DOS environmnet) and the other to run under Windows environment.

  10. #10
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    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.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center