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
Solved

MS versions of functions.

Posted on 1999-01-21
9
207 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

856 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