Solved

MS versions of functions.

Posted on 1999-01-21
9
210 Views
Last Modified: 2010-04-16
I am trying to write a console application in MSVC++ 5.0, and am using some code I wrote in Borland a long time ago. Can I write an app that will run in DOS mode? the console apps I generate with the wizard are 32 bit?

I want to use some screen functions namely gotoxy, and cprintf and the like, how can I use these under MSVC++. I also want to do some comms with serial ports and the parallel port. I used to use outportb and inportb, what are the MS versions of these functions?

Thanks.
Nigel
0
Comment
Question by:nigel5
9 Comments
 
LVL 8

Expert Comment

by:Answers2000
ID: 1184734
With VC5 you can write console Win32 programs using the Win32 API and runtime library.  The plus is that you get lots more memory and access to all the Win API, the minus is that nearly all the naughty (but fun) DOS stuff isn't allowed.

If you need to write true DOS apps, you need to use VC1.51.  This comes on (some only) copies of VC5 and VC4 CD-ROMs
0
 
LVL 22

Expert Comment

by:nietod
ID: 1184735
A win 32 console app can move the cursor around on the screen (and do a lot of similar stuff that would be hard to do under DOS.)  Look at SetConsoleCursorPos()
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1184736
For the serial communications you can use

#include <conio.h>
_inp and _outp

just keep in mind that windows may cause conflicts on some devices.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:mikeblas
ID: 1184737
_inp and _outp are unavailable in Win32.

B ekiM
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1184738
I am currently using _inp and _outp in my Win32 applications.  I am writing to both COM and LPT ports.  I haven't had any problems.

J.R.
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1184739
writing and reading..
0
 

Author Comment

by:nigel5
ID: 1184740
jrmcg

I have test my app, and I have not had any problems, do you want the points?

0
 
LVL 2

Accepted Solution

by:
jrmcg earned 50 total points
ID: 1184741
If you think my answer helped you the most then I will gladly accept the points.  Your question actually had a couple parts, I only answered one.  If you feel that someone else helped equally or more, you can reject my answer and we can split the points or something.

I'm glad I could help..

J.R.
0
 

Author Comment

by:nigel5
ID: 1184742
Its fine, I didn't really need the gotoxy stuff as I rewrote a windows app to handle it, and just supplied an interface.

Thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 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 viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

713 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