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

Bit Fields

Hi all I am trying to convert code that being written in C++ to C# and I
found that structure that using a property in C++ called "Bit Fields" and I
didn't found it in C#, is there any way to convert it to C#
thx all

typedef struct _tagCPB {
unsigned short DialMode :1;
unsigned short LineToPBX :1;
unsigned short TriggerMode :1;
unsigned short DetectRoaringRemoteHangUp :1;
unsigned short DetectBusyRemoteHangUp :1;
unsigned short DetectRemoteHangUpWhenRecording :1;
unsigned short DetectRemoteHangUpAlways :1;
unsigned short StopOperationRemoteHangUp :1;
unsigned short MonitorDTMF :1;
unsigned short MonitorEnergy :1;
unsigned short DetectVoltReverseRemoteHangUp :1;
unsigned short DetectSilentWhenRecording :1;
unsigned short LearnPulse :1;
unsigned short MonitorPulse :1;
unsigned short MonitorTone :1;
unsigned short :1;
unsigned short OffHookDelay;
unsigned short OnHookDelay;
unsigned short FlashTime;
unsigned short PulseMake;
unsigned short PulseBreak;
unsigned short PulsePostDigitPause;
unsigned short ToneDuration;
unsigned short InterTonePause;
unsigned char OutsideLineAccess;
unsigned char RingsToAnswer;
unsigned short WaitAnswerDuration;
unsigned short InterDigitPause;
unsigned short NoSignalTimeOut;
unsigned short MaxSilence;
unsigned short MaxRoarDuration;
char PlayGain;
char RecordGain;
unsigned char PlayMode;
unsigned char RecordMode;
unsigned char OffThreshold;
} typeCPB;
Sep 20 '06 #1
2 1764
I was never a C++ guy but take a look at the FlagsAttribute.

HTH

Glenn

"Just close your eyes and see"
<Ju*********************@discussions.microsoft.com wrote in message
news:E1**********************************@microsof t.com...
Hi all I am trying to convert code that being written in C++ to C# and I
found that structure that using a property in C++ called "Bit Fields" and
I
didn't found it in C#, is there any way to convert it to C#
thx all

typedef struct _tagCPB {
unsigned short DialMode :1;
unsigned short LineToPBX :1;
unsigned short TriggerMode :1;
unsigned short DetectRoaringRemoteHangUp :1;
unsigned short DetectBusyRemoteHangUp :1;
unsigned short DetectRemoteHangUpWhenRecording :1;
unsigned short DetectRemoteHangUpAlways :1;
unsigned short StopOperationRemoteHangUp :1;
unsigned short MonitorDTMF :1;
unsigned short MonitorEnergy :1;
unsigned short DetectVoltReverseRemoteHangUp :1;
unsigned short DetectSilentWhenRecording :1;
unsigned short LearnPulse :1;
unsigned short MonitorPulse :1;
unsigned short MonitorTone :1;
unsigned short :1;
unsigned short OffHookDelay;
unsigned short OnHookDelay;
unsigned short FlashTime;
unsigned short PulseMake;
unsigned short PulseBreak;
unsigned short PulsePostDigitPause;
unsigned short ToneDuration;
unsigned short InterTonePause;
unsigned char OutsideLineAccess;
unsigned char RingsToAnswer;
unsigned short WaitAnswerDuration;
unsigned short InterDigitPause;
unsigned short NoSignalTimeOut;
unsigned short MaxSilence;
unsigned short MaxRoarDuration;
char PlayGain;
char RecordGain;
unsigned char PlayMode;
unsigned char RecordMode;
unsigned char OffThreshold;
} typeCPB;

Sep 20 '06 #2
http://weblogs.asp.net/wim/archive/2...07/109095.aspx

HTH

Glenn
"Just close your eyes and see"
<Ju*********************@discussions.microsoft.com wrote in message
news:E1**********************************@microsof t.com...
Hi all I am trying to convert code that being written in C++ to C# and I
found that structure that using a property in C++ called "Bit Fields" and
I
didn't found it in C#, is there any way to convert it to C#
thx all

typedef struct _tagCPB {
unsigned short DialMode :1;
unsigned short LineToPBX :1;
unsigned short TriggerMode :1;
unsigned short DetectRoaringRemoteHangUp :1;
unsigned short DetectBusyRemoteHangUp :1;
unsigned short DetectRemoteHangUpWhenRecording :1;
unsigned short DetectRemoteHangUpAlways :1;
unsigned short StopOperationRemoteHangUp :1;
unsigned short MonitorDTMF :1;
unsigned short MonitorEnergy :1;
unsigned short DetectVoltReverseRemoteHangUp :1;
unsigned short DetectSilentWhenRecording :1;
unsigned short LearnPulse :1;
unsigned short MonitorPulse :1;
unsigned short MonitorTone :1;
unsigned short :1;
unsigned short OffHookDelay;
unsigned short OnHookDelay;
unsigned short FlashTime;
unsigned short PulseMake;
unsigned short PulseBreak;
unsigned short PulsePostDigitPause;
unsigned short ToneDuration;
unsigned short InterTonePause;
unsigned char OutsideLineAccess;
unsigned char RingsToAnswer;
unsigned short WaitAnswerDuration;
unsigned short InterDigitPause;
unsigned short NoSignalTimeOut;
unsigned short MaxSilence;
unsigned short MaxRoarDuration;
char PlayGain;
char RecordGain;
unsigned char PlayMode;
unsigned char RecordMode;
unsigned char OffThreshold;
} typeCPB;

Sep 20 '06 #3

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

Similar topics

2
by: Tim Cowan | last post by:
Hi I am trying to create a CSV file with some fields in double quotes ("). I am not having any luck. This is what I want; "8684","COSTING","000010001","REG",X4,15.00, ,14,0,14,9,6 I am...
0
by: bill mahoney | last post by:
I have access 2k and I have 2 tables. One is a 7X6 table representing a month with zeroes padding the fields where no day exist. For example February 2003 0 0 0 0 0 0 1 2 3 4 5 6 7 ...
4
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
2
by: Darryl Kerkeslager | last post by:
As the subject above hopefully makes clear, I want to do several reports, "with lots of fields not otherwise in database". These reports also have variable-length text. I have defined the...
0
by: Proteus | last post by:
Hi, I'm using access 97 on windows 98. I have table with 162 fields in it. I need to withdraw this information in a (totals) query with 164 fields (162 "avg" fields and 2 "count" fields). When I...
5
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
4
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
Hey, Well, I have a Problem. I have designed a table which has few fields which are being declared in the database of type .... char of length 10. and other fields with varchar 50 and...
9
by: sean.scanlon | last post by:
can someone help understand how i can could access a struct field dymanically like: foo->fields ? when i try to compile this i get the following error: 'struct pwd' has no member named 'fields'...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...

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.