Solved

MS versions of functions.

Posted on 1999-01-21
9
221 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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…
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 clear a vector as well as how to detect empty vectors in C++.

622 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