Everything Old is New Again

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.
LVL 3
RaydotAsked:
Who is Participating?
 
nietodConnect With a Mentor Commented:
Verson 1.42 (I believe that is right, 1. something) is the last version that was able to produce DOS programs.
0
 
nietodCommented:
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
 
RaydotAuthor Commented:
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
 
RaydotAuthor Commented:
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
 
nietodCommented:
>> 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.