Solved

Everything Old is New Again

Posted on 1998-07-07
5
192 Views
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?

Thanks,

Raydot.
0
Comment
Question by:Raydot
  • 3
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
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.
0
 
LVL 22

Expert Comment

by:nietod
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.
0
 
LVL 3

Author Comment

by:Raydot
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....

Thanks,

'Dot.
0
 
LVL 3

Author Comment

by:Raydot
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!

'Dot.
0
 
LVL 22

Expert Comment

by:nietod
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

820 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