Solved

Everything Old is New Again

Posted on 1998-07-07
5
183 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 how to clear a vector as well as how to detect empty vectors in C++.

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now