Solved

MS versions of functions.

Posted on 1999-01-21
9
182 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
 
LVL 11

Expert Comment

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

B ekiM
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
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 difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now