Click here to Skip to main content
15,884,473 members
Home / Discussions / C#
   

C#

 
GeneralRe: Exit statment in visual C# Pin
Heath Stewart22-Apr-04 3:01
protectorHeath Stewart22-Apr-04 3:01 
GeneralRe: Exit statment in visual C# Pin
A.Wegierski22-Apr-04 19:59
A.Wegierski22-Apr-04 19:59 
GeneralRe: Exit statment in visual C# Pin
SJ_Phoenix22-Apr-04 0:42
SJ_Phoenix22-Apr-04 0:42 
GeneralC++ Bit Fields implementation in C# Pin
Vini Deep21-Apr-04 23:33
Vini Deep21-Apr-04 23:33 
GeneralRe: C++ Bit Fields implementation in C# Pin
A.Wegierski22-Apr-04 1:10
A.Wegierski22-Apr-04 1:10 
GeneralRe: C++ Bit Fields implementation in C# Pin
Vini Deep22-Apr-04 1:31
Vini Deep22-Apr-04 1:31 
GeneralRe: C++ Bit Fields implementation in C# Pin
Member 363026618-Dec-08 19:53
Member 363026618-Dec-08 19:53 
GeneralRe: C++ Bit Fields implementation in C# Pin
Tim Kohler22-Apr-04 1:22
Tim Kohler22-Apr-04 1:22 
Your C# code could just pass/receive a uint from the .dll. Just use the bitwise operators in C# to set up or read the various bits.

You'd have to define your bits differently and wouldn't really use a 'bit field' but you'd get the same effect of storing several bools in a single 32 bit variable.

i.e.

C++:

const UINT32 ReadCdR = 0x00000001;
const UINT32 ReadCdRw = 0x00000002;
const UINT32 ReadDvdRom = 0x00000004;
...
const UINT32 TapeDrive = 0x0000FFFF;

bool DoSomething(UINT32 devType)
{
if (devType & ReadCdR)
...
}



C#:

private static uint ReadCdR = 0x00000001;
private static uint ReadCdRw = 0x00000002;
private static uint ReadDvdRom = 0x00000004;
...
private static uint TapeDrive = 0x0000FFFF;


public static CallSomethingInDll()
{
uint val = ReadCdR | ReadCdRw | TapeDrive;
bool ret = CPPWrapperOrManagedClass.DoSomething(val);
}





GeneralRe: C++ Bit Fields implementation in C# Pin
A.Wegierski22-Apr-04 19:57
A.Wegierski22-Apr-04 19:57 
GeneralRe: C++ Bit Fields implementation in C# Pin
leppie22-Apr-04 7:22
leppie22-Apr-04 7:22 
Generalstruct/class .vs. Datasets Pin
BernardYardley21-Apr-04 23:17
BernardYardley21-Apr-04 23:17 
GeneralRe: struct/class .vs. Datasets Pin
Heath Stewart22-Apr-04 3:07
protectorHeath Stewart22-Apr-04 3:07 
GeneralRe: struct/class .vs. Datasets Pin
BernardYardley22-Apr-04 3:20
BernardYardley22-Apr-04 3:20 
GeneralRe: struct/class .vs. Datasets Pin
Heath Stewart22-Apr-04 4:05
protectorHeath Stewart22-Apr-04 4:05 
GeneralRe: struct/class .vs. Datasets Pin
BernardYardley22-Apr-04 4:33
BernardYardley22-Apr-04 4:33 
GeneralRe: struct/class .vs. Datasets Pin
Heath Stewart22-Apr-04 4:40
protectorHeath Stewart22-Apr-04 4:40 
GeneralRe: struct/class .vs. Datasets Pin
BernardYardley22-Apr-04 4:52
BernardYardley22-Apr-04 4:52 
Generalshowing a bitmap Pin
Amirjalaly21-Apr-04 21:55
Amirjalaly21-Apr-04 21:55 
GeneralRe: showing a bitmap Pin
Mazdak22-Apr-04 0:48
Mazdak22-Apr-04 0:48 
GeneralCreating object instance only known object name Pin
PEDRO_PASAMAR21-Apr-04 21:01
PEDRO_PASAMAR21-Apr-04 21:01 
GeneralRe: Creating object instance only known object name Pin
Bilal Farooq21-Apr-04 22:20
Bilal Farooq21-Apr-04 22:20 
GeneralUsing Images of Satellite Assemblies Pin
Bilal Farooq21-Apr-04 19:54
Bilal Farooq21-Apr-04 19:54 
GeneralRe: Using Images of Satellite Assemblies Pin
Heath Stewart22-Apr-04 3:29
protectorHeath Stewart22-Apr-04 3:29 
GeneralGet currently active window Pin
Bilal Farooq21-Apr-04 19:42
Bilal Farooq21-Apr-04 19:42 
GeneralRe: Get currently active window Pin
A.Wegierski22-Apr-04 0:26
A.Wegierski22-Apr-04 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.