Everything Old is New Again

Posted on 1998-07-07
Last Modified: 2010-04-01
Can one use Visual C++ to write MS-DOS compatible programs?  Or can it only write things to be compiled and run in Windows '95, and so I have to buy an older compiler to write for DOS?


Question by:Raydot
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 22

Accepted Solution

nietod earned 100 total points
ID: 1167333
Verson 1.42 (I believe that is right, 1. something) is the last version that was able to produce DOS programs.
LVL 22

Expert Comment

ID: 1167334
Version 5 (the current, though 6 is to be out soon) will produce 32 bit windows programs only.  These will run on windows 3.1 with win32s, windows 95, windowss 98, and windows NT.  It does not even produce 16 bit windows programs.  However it can produce console programs which look like DOS programs to the user.  (They however are not able to DOS stuff, like call DOs interrupts and do dirrectly access physical memory.)

Borland C++ will still produce DOS programs.

Author Comment

ID: 1167335
All right, you answered this question before for me, although I asked it differently the last time.  I'm still trying to get a program that was obviously written in the days of DOS only to compile and run on my machine.  It ALMOST works, except it seems that Microsoft has thrown all of C++ convention out the window in creating Visual C++.  I don't even understand the difference between a .h and a .lib file, although the (limited) documentation seems to imply that it makes all the difference in the world.  

The problem is, VC++ doesn't understand the libraries in the program as they're typed.  But I can't believe they abandoned EVERYTHING.  I mean, there must be similar libraries, albiet with different names.

Maybe I just need to "devolve" to Borland...

I've bumped the points, if you have anything else you'd like to add....



Author Comment

ID: 1167336
Never mind.  I just looked over the last answer you gave me on a similar subject, and it's pretty comprehensive.  Well, that does it, my last hair has officially turned gray over worring about this!

LVL 22

Expert Comment

ID: 1167337
>> I don't even understand the difference between a .h and a .lib file,
>> although the (limited) documentation seems to imply that it makes
>> all the difference in the world.

They are VERY different.  I don't knwo what the other question was on so I don't know if that was in there. Do you understand that now?

>> Maybe I just need to "devolve" to Borland...
If you want a true DOS program that uses DOS specific feature.  Likes accesses the video memory or uses DOS's FCBs or call's DOS's interrupts etc.  Yes for that you need Borland or VC 1.x.  However, if you just want a "DOS-like" program that uses only standard C++, you can use a win32 console program written in VC (or Borland)  This program has to use standard C++ mechanisms for accessing the screen and keyboard, no DOS interrupts for moving the cursor.  It has to use standard C++ mechanisms for accessing files, again no DOS handles.  etc, but often this is no problem.  Basically any standard, portable C++ program that compiles for UNIX, the MAC, a VAC will compile and run fine as win32 console program.  However the win32 console program also has access to the win32 api.  It can use the windows API to move the cursor on the screen, change the display colors, start other programs, access the clipboard, create windows etc.

The question comes down to: is the program a standard C++ program or is it really a  DOS program that has DOS-specific code?

Let me know if you are shaky on the .h .lib thing.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question