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

x
?
Solved

MS versions of functions.

Posted on 1999-01-21
9
Medium Priority
?
225 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
[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
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 150 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

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

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…
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 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 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.

722 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