By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,004 Members | 2,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,004 IT Pros & Developers. It's quick & easy.

Porting from DOS to W32 - COM port

P: n/a
I need to port an application from DOS to W32.

The application wrote and read the hardware directly.

I know I need to use W32 SDK to access COM ports (USB Devices),
obviously the Windows way.

Several questions:

What should I download (of course I have the compiler - C++ Builder 6)?
I suppose I don't have to download the comllete SDK.

What is the relation of these matters with Net Framework?

Thanks
H. Martins

Jun 19 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Martins" <HJ********@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I need to port an application from DOS to W32.

The application wrote and read the hardware directly.

I know I need to use W32 SDK to access COM ports (USB Devices),
obviously the Windows way.

Several questions:

What should I download (of course I have the compiler - C++ Builder 6)?
I suppose I don't have to download the comllete SDK.

What is the relation of these matters with Net Framework?

Thanks
H. Martins


Definately a windows question. Try in one of the microsoft groups. I
normally suggest microsoft.public.vc.language
Jun 19 '06 #2

P: n/a
Martins wrote:
I need to port an application from DOS to W32.

Then ask on a windows group, this is OT here

--
Ian Collins.
Jun 19 '06 #3

P: n/a

"Martins" <HJ********@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
What should I download (of course I have the compiler - C++ Builder 6)?
I suppose I don't have to download the comllete SDK.
If you have Borland C++ Builder 6, you do also have the platform SDK.
Of course not a updated SDK but it dont matter when its only COM port
communications.

HANDLE ComPort = CreateFile("COM4", GENERIC_READ | GENERIC_WRITE, 0, 0,
OPEN_EXISTING, 0, 0); // Open COM port 4

You can then use ReadFile() and WriteFile() to send data on the port.
There are also GetCommState(), SetCommState(), GetCommTimeouts(),
SetCommTimeouts(), possible more cant remember them all. You can look them
up at msdn, and msdn has sample code as well.
What is the relation of these matters with Net Framework?


Borland C++ Builder has absolutely nothing to do with .NET framework.
However, you can use .NET from unmanaged C++, or from VB6 for that matter.
If you're working in .NET im sure there is a wrapper/class that makes it
very easy to use a serial port/usb/whatever.

You can get more help in comp.os.ms-windows.programmer.win32 and i guess you
can finde some groups that are more related to .NET programming as well.

//eric
Jun 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.