Click here to Skip to main content
15,916,600 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: WaitForSingleObject... Pin
Nish Nishant10-Oct-03 6:17
sitebuilderNish Nishant10-Oct-03 6:17 
GeneralRe: WaitForSingleObject... Pin
raitz10-Oct-03 7:17
raitz10-Oct-03 7:17 
GeneralRe: WaitForSingleObject... Pin
Rod O10-Oct-03 20:58
Rod O10-Oct-03 20:58 
GeneralRe: WaitForSingleObject... Pin
raitz15-Oct-03 10:21
raitz15-Oct-03 10:21 
GeneralDataGrids Pin
Tom S Morton9-Oct-03 21:26
sussTom S Morton9-Oct-03 21:26 
GeneralRe: DataGrids Pin
RBlyth9-Oct-03 21:54
RBlyth9-Oct-03 21:54 
GeneralDataGrids Pin
Anonymous9-Oct-03 21:25
Anonymous9-Oct-03 21:25 
QuestionWhat a terrible error! How can i use "union" in c# Pin
Anonymous9-Oct-03 17:06
Anonymous9-Oct-03 17:06 
I am from China, so please forgive my poor English.

I've got a terrible question when i try to use [FieldOffset ..] in C# to simulate the function of "union" in C.
this my code:

[StructLayout(LayoutKind.Explicit)]
public struct union
{
[FieldOffset(0)]
public union1 u1;

[FieldOffset(0)]
public union2 u2;
}

public struct union1
{
[MarshalAs (UnmanagedType.ByValArray,SizeConst=2)]
public byte[] arra1;
}

public struct union2
{
[MarshalAs(UnmanagedType.ByValArray,SizeConst=2)]
public byte[] arra2; //when I turn "byte" type to "int", it is OK! Or if i turn both "byte" to "int" in union1 and union2, it is OK too! ???
}



public void testUnion()
{
union u;
}

that is , I want to make a simple union comprising two "byte" Array at the
same offset, it's compiled successfully, but when i run testUnion(), i get a "System.TypeLoadException". What's more strange is that when i turn one or both of the two "byte" Array to "int" Array (or "long"), it just run Ok!
Any help will be deeply appreciated!
GeneralManaged C++ / Byte Array Pin
Rod Ob9-Oct-03 15:55
sussRod Ob9-Oct-03 15:55 
GeneralRe: Managed C++ / Byte Array Pin
Randhir Sinha13-Oct-03 0:21
Randhir Sinha13-Oct-03 0:21 
GeneralSubscript operator Pin
Member 6182867-Oct-03 4:47
Member 6182867-Oct-03 4:47 
GeneralWindows forms. Pin
raitz2-Oct-03 3:05
raitz2-Oct-03 3:05 
GeneralRe: Windows forms. Pin
Anonymous2-Oct-03 6:12
Anonymous2-Oct-03 6:12 
QuestionHow to use UNmanaged C++ in .NET (using managed C++) Pin
moist1-Oct-03 20:57
moist1-Oct-03 20:57 
AnswerRe: How to use UNmanaged C++ in .NET (using managed C++) Pin
technologydude1-Oct-03 21:01
technologydude1-Oct-03 21:01 
GeneralRe: How to use UNmanaged C++ in .NET (using managed C++) Pin
moist1-Oct-03 21:09
moist1-Oct-03 21:09 
GeneralRe: How to use UNmanaged C++ in .NET (using managed C++) Pin
Nemanja Trifunovic3-Oct-03 11:30
Nemanja Trifunovic3-Oct-03 11:30 
GeneralRe: How to use UNmanaged C++ in .NET (using managed C++) Pin
moist4-Oct-03 5:41
moist4-Oct-03 5:41 
GeneralRe: How to use UNmanaged C++ in .NET (using managed C++) Pin
Bo Hunter4-Oct-03 7:22
Bo Hunter4-Oct-03 7:22 
GeneralRe: How to use UNmanaged C++ in .NET (using managed C++) Pin
moist4-Oct-03 18:22
moist4-Oct-03 18:22 
GeneralRe: How to use UNmanaged C++ in .NET (using managed C++) Pin
Randhir Sinha6-Oct-03 2:42
Randhir Sinha6-Oct-03 2:42 
QuestionWhere to learn Managed C++.NET? Pin
Chua Wen Ching1-Oct-03 0:58
Chua Wen Ching1-Oct-03 0:58 
AnswerRe: Where to learn Managed C++.NET? Pin
Nish Nishant1-Oct-03 21:47
sitebuilderNish Nishant1-Oct-03 21:47 
GeneralRe: Where to learn Managed C++.NET? Pin
Chua Wen Ching1-Oct-03 23:31
Chua Wen Ching1-Oct-03 23:31 
GeneralRe: Where to learn Managed C++.NET? Pin
Nish Nishant2-Oct-03 1:14
sitebuilderNish Nishant2-Oct-03 1:14 

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.