469,128 Members | 1,661 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,128 developers. It's quick & easy.

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 4451
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jamil | last post: by
1 post views Thread by Chris | last post: by
3 posts views Thread by carmen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.