473,396 Members | 1,975 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,396 software developers and data experts.

How to import the Windows serial communication structure into Visual C#.NET

Hello Experts,
I am porting the C++ code into the Visual C#.NET. My C++ code is
mainly based on the serial communication. So I am using the windows
structure such as DCB.. etc and the windows functions frequently in my
C++ code. I came to know how to import the windows functions into
Visual C#.NET. But what is the method to import windows structure into
Visual C#.NET?

It will be very helpful for me if anybody can give me the WebID that
has information regarding importing the windows functions and the
structure into the Visual C#.NET

Thanks in advance for any help.

Regards,
Vidya Bhagwath
Nov 17 '05 #1
4 4716
Hi,

Take a look at an article from MSDN magazine that explain how to interact
with the serial port.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vidya Bhagwath" <vi************@gmail.com> wrote in message
news:85**************************@posting.google.c om...
Hello Experts,
I am porting the C++ code into the Visual C#.NET. My C++ code is
mainly based on the serial communication. So I am using the windows
structure such as DCB.. etc and the windows functions frequently in my
C++ code. I came to know how to import the windows functions into
Visual C#.NET. But what is the method to import windows structure into
Visual C#.NET?

It will be very helpful for me if anybody can give me the WebID that
has information regarding importing the windows functions and the
structure into the Visual C#.NET

Thanks in advance for any help.

Regards,
Vidya Bhagwath

Nov 17 '05 #2
Hi..

Also, the "general" answer to this is to see DllImport documentation. The
doc explains how you need to "reconstruct" C/C++ structures in C# to
manipulate them correctly. The Marshal class (under the covers) takes care
of passing the data correctly between unmanaged (C/C++) and managed (C#)
code.

John Puopolo
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uX**************@TK2MSFTNGP10.phx.gbl...
Hi,

Take a look at an article from MSDN magazine that explain how to interact
with the serial port.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vidya Bhagwath" <vi************@gmail.com> wrote in message
news:85**************************@posting.google.c om...
Hello Experts,
I am porting the C++ code into the Visual C#.NET. My C++ code is
mainly based on the serial communication. So I am using the windows
structure such as DCB.. etc and the windows functions frequently in my
C++ code. I came to know how to import the windows functions into
Visual C#.NET. But what is the method to import windows structure into
Visual C#.NET?

It will be very helpful for me if anybody can give me the WebID that
has information regarding importing the windows functions and the
structure into the Visual C#.NET

Thanks in advance for any help.

Regards,
Vidya Bhagwath


Nov 17 '05 #3
"John Puopolo" <jo**********@fastsearch.com.nospam> wrote in message news:<#l**************@TK2MSFTNGP09.phx.gbl>...
Hi..

Also, the "general" answer to this is to see DllImport documentation. The
doc explains how you need to "reconstruct" C/C++ structures in C# to
manipulate them correctly. The Marshal class (under the covers) takes care
of passing the data correctly between unmanaged (C/C++) and managed (C#)
code.

John Puopolo
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uX**************@TK2MSFTNGP10.phx.gbl...
Hi,

Take a look at an article from MSDN magazine that explain how to interact
with the serial port.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vidya Bhagwath" <vi************@gmail.com> wrote in message
news:85**************************@posting.google.c om...
Hello Experts,
I am porting the C++ code into the Visual C#.NET. My C++ code is
mainly based on the serial communication. So I am using the windows
structure such as DCB.. etc and the windows functions frequently in my
C++ code. I came to know how to import the windows functions into
Visual C#.NET. But what is the method to import windows structure into
Visual C#.NET?

It will be very helpful for me if anybody can give me the WebID that
has information regarding importing the windows functions and the
structure into the Visual C#.NET

Thanks in advance for any help.

Regards,
Vidya Bhagwath


Hi All,
I was sucessfully able to import Windows serial communication
structure into Visual C#.NET by following your suggestions. Thank you
very much for your guidance.
Regards,
Vidya Bhagwath
Nov 17 '05 #4
Vidaya, Could U please send me the class for the same...

Dear expert,

I am tring to communicate with a serial port. and I am using C# with .NET 1.1
and machine is XP. I have HSM(Host security module by THALES) to connect
with the following settings...

m_CommPort_obj.BaudRate = 9600;
m_CommPort_obj.ByteSize = 8;
m_CommPort_obj.Parity = 2;
m_CommPort_obj.PortNum = 1;
m_CommPort_obj.ReadTimeout = 100;
m_CommPort_obj.StopBits = 1;

I am using http://www.aciss.com/justin/JustinIO.zip, a class for the comm
and I am able to open, write on the port But unable to read the data from it.
Could anybody suggest, whats wrong with the code or settings ? and on which
bemt I should read.?

I do not want to use MSCOmm.ocx. Actually i am looking for the " running
code" in .NET(vb or C#) having method sends and receive data from the serial
port. On google, I have gone through almost all the link and get a lots of
code..... but not running, if running ... its with a lots of error. So if U
have tested code please give me the calss at least so that I can work with.

Thanks in ur anticipation
Reply me on "ra***********@3i-infotech.com" and ra*******@gmail.com
Rakesh.
"Vidya Bhagwath" wrote:
"John Puopolo" <jo**********@fastsearch.com.nospam> wrote in message news:<#l**************@TK2MSFTNGP09.phx.gbl>...
Hi..

Also, the "general" answer to this is to see DllImport documentation. The
doc explains how you need to "reconstruct" C/C++ structures in C# to
manipulate them correctly. The Marshal class (under the covers) takes care
of passing the data correctly between unmanaged (C/C++) and managed (C#)
code.

John Puopolo
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uX**************@TK2MSFTNGP10.phx.gbl...
Hi,

Take a look at an article from MSDN magazine that explain how to interact
with the serial port.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vidya Bhagwath" <vi************@gmail.com> wrote in message
news:85**************************@posting.google.c om...
> Hello Experts,
> I am porting the C++ code into the Visual C#.NET. My C++ code is
> mainly based on the serial communication. So I am using the windows
> structure such as DCB.. etc and the windows functions frequently in my
> C++ code. I came to know how to import the windows functions into
> Visual C#.NET. But what is the method to import windows structure into
> Visual C#.NET?
>
> It will be very helpful for me if anybody can give me the WebID that
> has information regarding importing the windows functions and the
> structure into the Visual C#.NET
>
> Thanks in advance for any help.
>
> Regards,
> Vidya Bhagwath

Hi All,
I was sucessfully able to import Windows serial communication
structure into Visual C#.NET by following your suggestions. Thank you
very much for your guidance.
Regards,
Vidya Bhagwath

Nov 17 '05 #5

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

Similar topics

1
by: sarah | last post by:
hI, I have a project. I need to realise serial communication between PC and Altera FPGA in c or c++. The function of FPGA is working well. it can send data to uart. Does anybody know how to...
11
by: sarah | last post by:
hI, I have a project. I need to realise serial communication between PC and Altera FPGA in c or c++. The function of FPGA is working well. it can send data to uart. Does anybody know how to...
1
by: Jamil | last post by:
I have a target box connected to my desktop (x86 Windows 2000) PC through a serial cable (COM port). The target box running on different processor and OS. The target box needs to send a specific...
1
by: Chris | last post by:
Hi, I'm trying to find out if a serial communication dll exists that would allow me to communicate to devices connected on the com port through .net. My implementation language will be C#. I...
3
by: carmen | last post by:
I'm working in an aplication for a Smart Device that need to "talk" with a printer continuosly through the serial port. I'm trying to use the John Hint's sample code "Use P/Invoke to develop a .NET...
0
by: fswfsw | last post by:
Hallo everybody: I have some questions about Seiral communication with GPS. I am using the "Serial Port" in Windows application form of Visual studio 2005. In one second I receive several...
4
by: nmsreddi | last post by:
Hi friends , after a long busy work happy to back to forums, i have developed a windows application(C#2,0) for serial communication. the aim of my application is to connect to external...
1
by: lakshmiRam | last post by:
hi i have written the following code to receive data from mobile using bluetooth through serial communication. but it is not working <code> #include <stdio.h> #include <conio.h> #include...
1
by: InduGokul | last post by:
i want to perform serial communication on selecting .Net Framework2.0--->Visual Basic--->Device application presently i am using this code Imports System.IO.Ports Imports...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.