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

C++ style Bit Fields in VB.NET

I have the following structure (for example) that I wish to convert for use
in VB.NET. What would be the best way to do it? Ideally, it would convert
directly to allow access to the bit fields in the same way as in C++, but I
cannot see any mention of bit field declarations in VB.NET.

<structure>
typedef struct _DCB {
DWORD DCBlength;
DWORD BaudRate;
DWORD fBinary :1;
DWORD fParity :1;
DWORD fOutxCtsFlow :1;
DWORD fOutxDsrFlow :1;
DWORD fDtrControl :2;
DWORD fDsrSensitivity :1;
DWORD fTXContinueOnXoff :1;
DWORD fOutX :1;
DWORD fInX :1;
DWORD fErrorChar :1;
DWORD fNull :1;
DWORD fRtsControl :2;
DWORD fAbortOnError :1;
DWORD fDummy2 :17;
WORD wReserved;
WORD XonLim;
WORD XoffLim;
BYTE ByteSize;
BYTE Parity;
BYTE StopBits;
char XonChar;
char XoffChar;
char ErrorChar;
char EofChar;
char EvtChar;
WORD wReserved1;
} DCB;
</structure>

TIA

Charles
Nov 20 '05 #1
6 3398
There is no bit field access in VB.Net (or C#). I've found that the best
representation is something like this:

Public Class Test
Private DCBInstance As DCB
Public Sub SomeSub()
If (DCBInstance.DCBFlags And DCBFlagsMask.TXContinueOnXoff) =
DCBFlagsMask.TXContinueOnXoff Then
'Bit Set
End If
Dim fDtrControlBits As Integer = DCBInstance.DCBFlags And
DCBFlagsMask.DtrControl
'Do something
'Etc.
End Sub
End Class

<Flags()> Public Enum DCBFlagsMask
Binary = &H1
Parity = &H2
OutxCtsFlow = &H4
OutxDsrFlow = &H8
DtrControl = &H10 Or &H20
DsrSensitivity = &H40
TXContinueOnXoff = &H80
OutX = &H100
InX = &H200
ErrorChar = &H400
Null = &H800
RtsControl = &H1000 Or &H2000
AbortOnError = &H4000
Dummy = &HFFFF8000
End Enum

<StructLayout(LayoutKind.Sequential)> _
Public Structure DCB
Public DCBlength As Integer
Public BaudRate As Integer
Public DCBFlags As DCBFlagsMask
'DWORD fBinary :1;
'DWORD fParity :1;
'DWORD fOutxCtsFlow :1;
'DWORD fOutxDsrFlow :1;
'DWORD fDtrControl :2;
'DWORD fDsrSensitivity :1;
'DWORD fTXContinueOnXoff :1;
'DWORD fOutX :1;
'DWORD fInX :1;
'DWORD fErrorChar :1;
'DWORD fNull :1;
'DWORD fRtsControl :2;
'DWORD fAbortOnError :1;
'DWORD fDummy2 :17;
Public wReserved As Short
Public XonLim As Short
Public XoffLim As Short
Public ByteSize As Byte
Public Parity As Byte
Public StopBits As Byte
Public XonChar As Byte
Public XoffChar As Byte
Public ErrorChar As Byte
Public EofChar As Byte
Public EvtChar As Byte
Public wReserved1 As Short
End Structure

"Charles Law" <bl**@thingummy.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have the following structure (for example) that I wish to convert for use in VB.NET. What would be the best way to do it? Ideally, it would convert
directly to allow access to the bit fields in the same way as in C++, but I cannot see any mention of bit field declarations in VB.NET.

<structure>
typedef struct _DCB {
DWORD DCBlength;
DWORD BaudRate;
DWORD fBinary :1;
DWORD fParity :1;
DWORD fOutxCtsFlow :1;
DWORD fOutxDsrFlow :1;
DWORD fDtrControl :2;
DWORD fDsrSensitivity :1;
DWORD fTXContinueOnXoff :1;
DWORD fOutX :1;
DWORD fInX :1;
DWORD fErrorChar :1;
DWORD fNull :1;
DWORD fRtsControl :2;
DWORD fAbortOnError :1;
DWORD fDummy2 :17;
WORD wReserved;
WORD XonLim;
WORD XoffLim;
BYTE ByteSize;
BYTE Parity;
BYTE StopBits;
char XonChar;
char XoffChar;
char ErrorChar;
char EofChar;
char EvtChar;
WORD wReserved1;
} DCB;
</structure>

TIA

Charles

Nov 20 '05 #2
Hi Stephen

Thanks for the suggestion. It has set me thinking. I am now wondering about
adding functions to the DCB structure for manipulating the bit fields, for
example

Public Function IsSet(ByVal Value As DCBFlagsMask) As Boolean
Return (DCBFlags And Value) = Value
End Function

and similar functions called Set and Reset.

Charles
"Stephen Martin" <sm*****@removethis.emsoft.andthis.ca> wrote in message
news:Ol****************@TK2MSFTNGP10.phx.gbl...
There is no bit field access in VB.Net (or C#). I've found that the best
representation is something like this:

Public Class Test
Private DCBInstance As DCB
Public Sub SomeSub()
If (DCBInstance.DCBFlags And DCBFlagsMask.TXContinueOnXoff) =
DCBFlagsMask.TXContinueOnXoff Then
'Bit Set
End If
Dim fDtrControlBits As Integer = DCBInstance.DCBFlags And
DCBFlagsMask.DtrControl
'Do something
'Etc.
End Sub
End Class

<Flags()> Public Enum DCBFlagsMask
Binary = &H1
Parity = &H2
OutxCtsFlow = &H4
OutxDsrFlow = &H8
DtrControl = &H10 Or &H20
DsrSensitivity = &H40
TXContinueOnXoff = &H80
OutX = &H100
InX = &H200
ErrorChar = &H400
Null = &H800
RtsControl = &H1000 Or &H2000
AbortOnError = &H4000
Dummy = &HFFFF8000
End Enum

<StructLayout(LayoutKind.Sequential)> _
Public Structure DCB
Public DCBlength As Integer
Public BaudRate As Integer
Public DCBFlags As DCBFlagsMask
'DWORD fBinary :1;
'DWORD fParity :1;
'DWORD fOutxCtsFlow :1;
'DWORD fOutxDsrFlow :1;
'DWORD fDtrControl :2;
'DWORD fDsrSensitivity :1;
'DWORD fTXContinueOnXoff :1;
'DWORD fOutX :1;
'DWORD fInX :1;
'DWORD fErrorChar :1;
'DWORD fNull :1;
'DWORD fRtsControl :2;
'DWORD fAbortOnError :1;
'DWORD fDummy2 :17;
Public wReserved As Short
Public XonLim As Short
Public XoffLim As Short
Public ByteSize As Byte
Public Parity As Byte
Public StopBits As Byte
Public XonChar As Byte
Public XoffChar As Byte
Public ErrorChar As Byte
Public EofChar As Byte
Public EvtChar As Byte
Public wReserved1 As Short
End Structure

"Charles Law" <bl**@thingummy.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have the following structure (for example) that I wish to convert for use
in VB.NET. What would be the best way to do it? Ideally, it would convert directly to allow access to the bit fields in the same way as in C++,

but I
cannot see any mention of bit field declarations in VB.NET.

<structure>
typedef struct _DCB {
DWORD DCBlength;
DWORD BaudRate;
DWORD fBinary :1;
DWORD fParity :1;
DWORD fOutxCtsFlow :1;
DWORD fOutxDsrFlow :1;
DWORD fDtrControl :2;
DWORD fDsrSensitivity :1;
DWORD fTXContinueOnXoff :1;
DWORD fOutX :1;
DWORD fInX :1;
DWORD fErrorChar :1;
DWORD fNull :1;
DWORD fRtsControl :2;
DWORD fAbortOnError :1;
DWORD fDummy2 :17;
WORD wReserved;
WORD XonLim;
WORD XoffLim;
BYTE ByteSize;
BYTE Parity;
BYTE StopBits;
char XonChar;
char XoffChar;
char ErrorChar;
char EofChar;
char EvtChar;
WORD wReserved1;
} DCB;
</structure>

TIA

Charles


Nov 20 '05 #3
Charles,
As Stephen stated, there is not bit field access in C# or VB.NET per se.
There is however a System.Collections.BitVector32 class that gives you
access to bit fields.

When I implemented the DCB structure in VB.NET I defined Flags as a Private
BitVector32. Then used Property procedures that extracted the individual
values, using the methods of BitVector32.

Public enum RtsControl As Byte
Disable = 0
Enable = 1
Handshake = 2
Toggle = 3
End Enum

Public Structure DBC
...
Private Flags As BitVector32
...

Private Shared Readonly m_fBinary As Integer
Private Shared Readonly m_Parity As Integer
...
Private Shared Readonly m_fRtsControl As BitVector32.Section
...

Shared Sub New()
' create boolean masks
m_fBinary = BitVector32.CreateMask()
...
m_fParity = BitVector32.CreateMask(m_fBinary)
...
' create section masks
Dim previousSection As BitVector32.Section
previousSection = BitVector32.CreateSection(1)
...
m_fRtsControl = BitVector32.CreateSection(3,
previousSection)
...
End Sub

Public Property Binary As Boolean
Get
Return Flags.Item(m_fBinary)
End Get
Set(ByVal value As Boolean)
Flags.Item(m_fBinary) = value
End Set
End Property

...

Public Property RtsControl As RtsControl
Get
Return CType(Flags.Item(m_fRtsControl), RtsControl)
End Get
Set(ByVal value As RtsControl)
Flags.Item(m_fRtsControl) = value
End Set
End Property

...

End Structure

BitVector32 is marshaled as an Integer (DWORD) so you can use them
interchangeably.

I made Flags Private as its an implementation detail.

The property procedures expose the flags as the respective types, For
example RtsControl & DtrControl as enums with valid values, others as
Boolean. I had to change a couple names as there is a field & a flag
(ErrorChar).

For the BitVector32 masks I had to make two passes, once for the boolean
values, then a second one for the section (enum) values.

Using the BitVector32 class simplified my property procedures at the
"expense" of a little extra setup (the shared constructor).

I have not posted my class on got dot net yet, as I am still working on
making the WaitEvent async.

Hope this helps
Jay

"Charles Law" <bl**@thingummy.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have the following structure (for example) that I wish to convert for use in VB.NET. What would be the best way to do it? Ideally, it would convert
directly to allow access to the bit fields in the same way as in C++, but I cannot see any mention of bit field declarations in VB.NET.

<structure>
typedef struct _DCB {
DWORD DCBlength;
DWORD BaudRate;
DWORD fBinary :1;
DWORD fParity :1;
DWORD fOutxCtsFlow :1;
DWORD fOutxDsrFlow :1;
DWORD fDtrControl :2;
DWORD fDsrSensitivity :1;
DWORD fTXContinueOnXoff :1;
DWORD fOutX :1;
DWORD fInX :1;
DWORD fErrorChar :1;
DWORD fNull :1;
DWORD fRtsControl :2;
DWORD fAbortOnError :1;
DWORD fDummy2 :17;
WORD wReserved;
WORD XonLim;
WORD XoffLim;
BYTE ByteSize;
BYTE Parity;
BYTE StopBits;
char XonChar;
char XoffChar;
char ErrorChar;
char EofChar;
char EvtChar;
WORD wReserved1;
} DCB;
</structure>

TIA

Charles

Nov 20 '05 #4
Hi Jay

It certainly does help. Top man.

Cheers

Charles
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
Charles,
As Stephen stated, there is not bit field access in C# or VB.NET per se.
There is however a System.Collections.BitVector32 class that gives you
access to bit fields.

When I implemented the DCB structure in VB.NET I defined Flags as a Private BitVector32. Then used Property procedures that extracted the individual
values, using the methods of BitVector32.

Public enum RtsControl As Byte
Disable = 0
Enable = 1
Handshake = 2
Toggle = 3
End Enum

Public Structure DBC
...
Private Flags As BitVector32
...

Private Shared Readonly m_fBinary As Integer
Private Shared Readonly m_Parity As Integer
...
Private Shared Readonly m_fRtsControl As BitVector32.Section
...

Shared Sub New()
' create boolean masks
m_fBinary = BitVector32.CreateMask()
...
m_fParity = BitVector32.CreateMask(m_fBinary)
...
' create section masks
Dim previousSection As BitVector32.Section
previousSection = BitVector32.CreateSection(1)
...
m_fRtsControl = BitVector32.CreateSection(3,
previousSection)
...
End Sub

Public Property Binary As Boolean
Get
Return Flags.Item(m_fBinary)
End Get
Set(ByVal value As Boolean)
Flags.Item(m_fBinary) = value
End Set
End Property

...

Public Property RtsControl As RtsControl
Get
Return CType(Flags.Item(m_fRtsControl), RtsControl)
End Get
Set(ByVal value As RtsControl)
Flags.Item(m_fRtsControl) = value
End Set
End Property

...

End Structure

BitVector32 is marshaled as an Integer (DWORD) so you can use them
interchangeably.

I made Flags Private as its an implementation detail.

The property procedures expose the flags as the respective types, For
example RtsControl & DtrControl as enums with valid values, others as
Boolean. I had to change a couple names as there is a field & a flag
(ErrorChar).

For the BitVector32 masks I had to make two passes, once for the boolean
values, then a second one for the section (enum) values.

Using the BitVector32 class simplified my property procedures at the
"expense" of a little extra setup (the shared constructor).

I have not posted my class on got dot net yet, as I am still working on
making the WaitEvent async.

Hope this helps
Jay

"Charles Law" <bl**@thingummy.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have the following structure (for example) that I wish to convert for use
in VB.NET. What would be the best way to do it? Ideally, it would convert directly to allow access to the bit fields in the same way as in C++,

but I
cannot see any mention of bit field declarations in VB.NET.

<structure>
typedef struct _DCB {
DWORD DCBlength;
DWORD BaudRate;
DWORD fBinary :1;
DWORD fParity :1;
DWORD fOutxCtsFlow :1;
DWORD fOutxDsrFlow :1;
DWORD fDtrControl :2;
DWORD fDsrSensitivity :1;
DWORD fTXContinueOnXoff :1;
DWORD fOutX :1;
DWORD fInX :1;
DWORD fErrorChar :1;
DWORD fNull :1;
DWORD fRtsControl :2;
DWORD fAbortOnError :1;
DWORD fDummy2 :17;
WORD wReserved;
WORD XonLim;
WORD XoffLim;
BYTE ByteSize;
BYTE Parity;
BYTE StopBits;
char XonChar;
char XoffChar;
char ErrorChar;
char EofChar;
char EvtChar;
WORD wReserved1;
} DCB;
</structure>

TIA

Charles


Nov 20 '05 #5
Hi Charles,

Depending on how you want to use the structure that could be a good approach. Jay's suggestion is also good, I don't use it more
from personal preference than anything. I find using a flags enum and masking to be more readable but that may just be me. I'd
probably do it something along these lines:

<StructLayout(LayoutKind.Sequential)> _
Public Structure DCB
Public DCBlength As Integer
Public BaudRate As Integer
Private DCBFlags As DCBFlagsMask
'DWORD fBinary :1;
'DWORD fParity :1;
'DWORD fOutxCtsFlow :1;
'DWORD fOutxDsrFlow :1;
'DWORD fDtrControl :2;
'DWORD fDsrSensitivity :1;
'DWORD fTXContinueOnXoff :1;
'DWORD fOutX :1;
'DWORD fInX :1;
'DWORD fErrorChar :1;
'DWORD fNull :1;
'DWORD fRtsControl :2;
'DWORD fAbortOnError :1;
'DWORD fDummy2 :17;
Public wReserved As Short
Public XonLim As Short
Public XoffLim As Short
Public ByteSize As Byte
Public Parity As Byte
Public StopBits As Byte
Public XonChar As Byte
Public XoffChar As Byte
Public ErrorChar As Byte
Public EofChar As Byte
Public EvtChar As Byte
Public wReserved1 As Short

Public Property fBinary() As Boolean
Get
Return ((DCBFlags And DCBFlagsMask.Binary) = DCBFlagsMask.Binary)
End Get
Set(ByVal Value As Boolean)
If Value Then
DCBFlags = DCBFlags Or DCBFlagsMask.Binary
Else
DCBFlags = DCBFlags And (Not DCBFlagsMask.Binary)
End If
End Set
End Property

Public Property fParity() As Boolean
Get
Return ((DCBFlags And DCBFlagsMask.Parity) = DCBFlagsMask.Parity)
End Get
Set(ByVal Value As Boolean)
If Value Then
DCBFlags = DCBFlags Or DCBFlagsMask.Parity
Else
DCBFlags = DCBFlags And (Not DCBFlagsMask.Parity)
End If
End Set
End Property

'Etc.
Nov 20 '05 #6
Thanks for the ideas Stephen. I've now got plenty to think about.

Cheers

Charles
"Stephen Martin" <sm*****@removethis.emsoft.andthis.ca> wrote in message
news:uf**************@TK2MSFTNGP10.phx.gbl...
Hi Charles,

Depending on how you want to use the structure that could be a good approach. Jay's suggestion is also good, I don't use it more from personal preference than anything. I find using a flags enum and masking to be more readable but that may just be me. I'd probably do it something along these lines:

<StructLayout(LayoutKind.Sequential)> _
Public Structure DCB
Public DCBlength As Integer
Public BaudRate As Integer
Private DCBFlags As DCBFlagsMask
'DWORD fBinary :1;
'DWORD fParity :1;
'DWORD fOutxCtsFlow :1;
'DWORD fOutxDsrFlow :1;
'DWORD fDtrControl :2;
'DWORD fDsrSensitivity :1;
'DWORD fTXContinueOnXoff :1;
'DWORD fOutX :1;
'DWORD fInX :1;
'DWORD fErrorChar :1;
'DWORD fNull :1;
'DWORD fRtsControl :2;
'DWORD fAbortOnError :1;
'DWORD fDummy2 :17;
Public wReserved As Short
Public XonLim As Short
Public XoffLim As Short
Public ByteSize As Byte
Public Parity As Byte
Public StopBits As Byte
Public XonChar As Byte
Public XoffChar As Byte
Public ErrorChar As Byte
Public EofChar As Byte
Public EvtChar As Byte
Public wReserved1 As Short

Public Property fBinary() As Boolean
Get
Return ((DCBFlags And DCBFlagsMask.Binary) = DCBFlagsMask.Binary)
End Get
Set(ByVal Value As Boolean)
If Value Then
DCBFlags = DCBFlags Or DCBFlagsMask.Binary
Else
DCBFlags = DCBFlags And (Not DCBFlagsMask.Binary)
End If
End Set
End Property

Public Property fParity() As Boolean
Get
Return ((DCBFlags And DCBFlagsMask.Parity) = DCBFlagsMask.Parity)
End Get
Set(ByVal Value As Boolean)
If Value Then
DCBFlags = DCBFlags Or DCBFlagsMask.Parity
Else
DCBFlags = DCBFlags And (Not DCBFlagsMask.Parity)
End If
End Set
End Property

'Etc.
.
.
.

Public Property fRtsControl() As RtsControl
Get
Return CType((DCBFlags And DCBFlagsMask.RtsControl) >> 12, RtsControl) End Get
Set(ByVal Value As RtsControl)
DCBFlags = CType((DCBFlags And (Not DCBFlagsMask.RtsControl)) Or Value << 12, DCBFlagsMask) End Set
End Property

Public Property fAbortOnError() As Boolean
Get
Return ((DCBFlags And DCBFlagsMask.AbortOnError) = DCBFlagsMask.AbortOnError) End Get
Set(ByVal Value As Boolean)
If Value Then
DCBFlags = DCBFlags Or DCBFlagsMask.AbortOnError
Else
DCBFlags = DCBFlags And (Not DCBFlagsMask.AbortOnError)
End If
End Set
End Property

<Flags()> Private Enum DCBFlagsMask
Binary = &H1
Parity = &H2
OutxCtsFlow = &H4
OutxDsrFlow = &H8
DtrControl = &H10 Or &H20
DsrSensitivity = &H40
TXContinueOnXoff = &H80
OutX = &H100
InX = &H200
ErrorChar = &H400
Null = &H800
RtsControl = &H1000 Or &H2000
AbortOnError = &H4000
Dummy = &HFFFF8000
End Enum

Public Enum DtrControl
DTR_CONTROL_DISABLE
DTR_CONTROL_ENABLE
DTR_CONTROL_HANDSHAKE
End Enum

Public Enum RtsControl
RTS_CONTROL_DISABLE
RTS_CONTROL_ENABLE
RTS_CONTROL_HANDSHAKE
RTS_CONTROL_TOGGLE
End Enum

End Structure


"Charles Law" <bl**@thingummy.com> wrote in message

news:eM**************@TK2MSFTNGP10.phx.gbl...
Hi Stephen

Thanks for the suggestion. It has set me thinking. I am now wondering about adding functions to the DCB structure for manipulating the bit fields, for example

Public Function IsSet(ByVal Value As DCBFlagsMask) As Boolean
Return (DCBFlags And Value) = Value
End Function

and similar functions called Set and Reset.

Charles
"Stephen Martin" <sm*****@removethis.emsoft.andthis.ca> wrote in message
news:Ol****************@TK2MSFTNGP10.phx.gbl...
There is no bit field access in VB.Net (or C#). I've found that the best representation is something like this:

Public Class Test
Private DCBInstance As DCB
Public Sub SomeSub()
If (DCBInstance.DCBFlags And DCBFlagsMask.TXContinueOnXoff) =
DCBFlagsMask.TXContinueOnXoff Then
'Bit Set
End If
Dim fDtrControlBits As Integer = DCBInstance.DCBFlags And
DCBFlagsMask.DtrControl
'Do something
'Etc.
End Sub
End Class

<Flags()> Public Enum DCBFlagsMask
Binary = &H1
Parity = &H2
OutxCtsFlow = &H4
OutxDsrFlow = &H8
DtrControl = &H10 Or &H20
DsrSensitivity = &H40
TXContinueOnXoff = &H80
OutX = &H100
InX = &H200
ErrorChar = &H400
Null = &H800
RtsControl = &H1000 Or &H2000
AbortOnError = &H4000
Dummy = &HFFFF8000
End Enum

<StructLayout(LayoutKind.Sequential)> _
Public Structure DCB
Public DCBlength As Integer
Public BaudRate As Integer
Public DCBFlags As DCBFlagsMask
'DWORD fBinary :1;
'DWORD fParity :1;
'DWORD fOutxCtsFlow :1;
'DWORD fOutxDsrFlow :1;
'DWORD fDtrControl :2;
'DWORD fDsrSensitivity :1;
'DWORD fTXContinueOnXoff :1;
'DWORD fOutX :1;
'DWORD fInX :1;
'DWORD fErrorChar :1;
'DWORD fNull :1;
'DWORD fRtsControl :2;
'DWORD fAbortOnError :1;
'DWORD fDummy2 :17;
Public wReserved As Short
Public XonLim As Short
Public XoffLim As Short
Public ByteSize As Byte
Public Parity As Byte
Public StopBits As Byte
Public XonChar As Byte
Public XoffChar As Byte
Public ErrorChar As Byte
Public EofChar As Byte
Public EvtChar As Byte
Public wReserved1 As Short
End Structure

"Charles Law" <bl**@thingummy.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
> I have the following structure (for example) that I wish to convert for use
> in VB.NET. What would be the best way to do it? Ideally, it would

convert
> directly to allow access to the bit fields in the same way as in
C++, but
I
> cannot see any mention of bit field declarations in VB.NET.
>
> <structure>
> typedef struct _DCB {
> DWORD DCBlength;
> DWORD BaudRate;
> DWORD fBinary :1;
> DWORD fParity :1;
> DWORD fOutxCtsFlow :1;
> DWORD fOutxDsrFlow :1;
> DWORD fDtrControl :2;
> DWORD fDsrSensitivity :1;
> DWORD fTXContinueOnXoff :1;
> DWORD fOutX :1;
> DWORD fInX :1;
> DWORD fErrorChar :1;
> DWORD fNull :1;
> DWORD fRtsControl :2;
> DWORD fAbortOnError :1;
> DWORD fDummy2 :17;
> WORD wReserved;
> WORD XonLim;
> WORD XoffLim;
> BYTE ByteSize;
> BYTE Parity;
> BYTE StopBits;
> char XonChar;
> char XoffChar;
> char ErrorChar;
> char EofChar;
> char EvtChar;
> WORD wReserved1;
> } DCB;
> </structure>
>
> TIA
>
> Charles
>
>



Nov 20 '05 #7

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

Similar topics

1
by: dmb000006 | last post by:
Hello, I have a database style data structure, each record has several fields. I would like to create a nested data structure that would let me 'query' the data on the value of certain...
2
by: Mark | last post by:
Hi - I want to allow users of an intranet application, to select their own colours etc. So I have a tbale in my database, which has fields called bgcolour, fontcolour etc. As I want all pages...
13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
26
by: Desmond Liu | last post by:
I've read articles like Scott Meyer's EC++ (Item 22) that advocate the use of references when passing parameters. I understand the reasoning behind using references--you avoid the cost of creating...
5
by: Ben | last post by:
I have a form for data entry which is in a table. I have a select box to enter a customer name, which takes it's options from the customer database. I have a button to add a new customer. What I...
39
by: Patrick | last post by:
The c# code style guide that I follow suggests that class variables (fields) be coded with camel casing, like this: int recordId; string name; It also suggests that variables within methods...
1
by: RonY | last post by:
I have a dropdown which calls SetTimePeriod method on change the selection. In the JS function, I reset the field style.display based on what the selection is. This works fine with IE but not working...
2
by: Jeff Rush | last post by:
While I have a reasonable understanding of the differences in new-style versus old-style classes, tonight while working a C extension module I realized I don't know how to indicate which style my C...
4
jullianps
by: jullianps | last post by:
I have an ASP page where I have a "Repeat region" which is populated dinamycally from a Database, everything works perfectly, the thing is that I thought it would be cool to fill a row or to set its...
2
by: plsHelpMe | last post by:
Hi All, I am facing a weired issue. I am having a search form with some of the fields on it and a button which submits these fields values. Functionaly everything is working fine but sometimes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.