473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Talking to a standard serial port

Is there a convenient function that will allow reading a standard serial
port (ala the kind that a mouse was typically plugged into before USB came
out)? I can also use DirectX if this would make it easier than without it...

In any case, what do I need to know to talk to a serial port using MS.NET
managed C++ 2005 using old syntax?

Thanks in advance for responses...! : )

[==P==]
Nov 17 '05 #1
6 1035
Hi Peter!
In any case, what do I need to know to talk to a serial port using MS.NET
managed C++ 2005 using old syntax?


See: SerialPort Class
http://msdn2.microsoft.com/library/30swa673

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #2
Thanks Jochen! Do happen to know if there is any sample code available using
the SerialPort class? There is none in MSDN...

[==P==]

"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
Hi Peter!
In any case, what do I need to know to talk to a serial port using MS.NET
managed C++ 2005 using old syntax?


See: SerialPort Class
http://msdn2.microsoft.com/library/30swa673

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #3
Hi Peter!
Thanks Jochen! Do happen to know if there is any sample code available using
the SerialPort class? There is none in MSDN...


Not in C++ but you can use the C# samples as well:
http://www.codeproject.com/csharp/Se...munication.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #4
Cool, thanks! : )

Is this class supported if you use 2005 but with *old syntax*? It doesn't
like the following line (C++):

using namespace System::IO::Ports ;

The compiler claims that Ports doesn't exist as part of System::IO. Do I
need somw sort of include here? For context, my project was initially a 2003
project, I've converted it over to 2005, but kept old syntax. It compiles
and runs provided I keep the black Console screen...

[==P==]

"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
Hi Peter!
Thanks Jochen! Do happen to know if there is any sample code available
using the SerialPort class? There is none in MSDN...


Not in C++ but you can use the C# samples as well:
http://www.codeproject.com/csharp/Se...munication.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #5
Hi Peter!
Is this class supported if you use 2005 but with *old syntax*? It doesn't
like the following line (C++):

using namespace System::IO::Ports ;

The compiler claims that Ports doesn't exist as part of System::IO. Do I
need somw sort of include here? For context, my project was initially a 2003
project, I've converted it over to 2005, but kept old syntax. It compiles
and runs provided I keep the black Console screen...


Maybe it uses the old .NET 1.1 assembly?

Please check your project settings under the "Common Properties" and
verify the you are refering the v2.0 assemblies!

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #6
Hi Jochen,

For some reason it started working (I think I might have added system.dll as
a reference to make it work, which might have brought in Framework 2.0). Or
it could be because I created a new 'using' immediatelt below its root
(i.e., I put "using System::IO:Ports" directly under "using System::IO")...

Thanks! I can now create a SerialPort class instance, so I got my perverbial
'foot in the door'! lol : )

[==P==]

PS - I really do like 2005 the improvements to the GUI, which is why I'm
making the efffort to switch. Also some of the new functionality in 2005 is
very helpful (e.g., Form's DoubleBuffered to elliminate flicker)... : )
"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
Hi Peter!
Is this class supported if you use 2005 but with *old syntax*? It doesn't
like the following line (C++):

using namespace System::IO::Ports ;

The compiler claims that Ports doesn't exist as part of System::IO. Do I
need somw sort of include here? For context, my project was initially a
2003 project, I've converted it over to 2005, but kept old syntax. It
compiles and runs provided I keep the black Console screen...


Maybe it uses the old .NET 1.1 assembly?

Please check your project settings under the "Common Properties" and
verify the you are refering the v2.0 assemblies!

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: ^CeFoS^ | last post by:
Hello to everybody, I've done an application that draws in a frame the trajectory of a robot. The robot position is readed through the serial port, and several commands are wrote through the...
2
by: Mike C. | last post by:
I am trying to get Java v1.4.2 to use my PCI add-on serial port. So far, everything I try gives me javax.comm.NoSuchPortException at...
2
by: willie | last post by:
Hi, I'm writing a program which requires the use of three serial ports and one parallel port. My application has a scanning devices on each port, which I can access fine with pyserial. ...
13
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have...
6
by: Don | last post by:
Environment: VB6 under W98 I have a USB hardware device I wish to program directly. The original software installed a low level driver and the hardware is both registered and operational. Now...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
4
by: Frank | last post by:
Hello, how to get information about all serial ports in the PC? I use the following code, but i got only the data of the FIRST serial port. All other serial port information are not available...
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
14
by: Freddy Coal | last post by:
Hi, I would like know how make the 'conversation' between VB.Net and Garmin USB GPS, someone know work that?. I have a etrex Vista Cx (USB cable connector), I would like make a program for get...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.