Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Everything Old is New Again

Posted on 1998-07-07
5
Medium Priority
?
205 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
[X]
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
5 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 400 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

660 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