Click here to Skip to main content
15,887,434 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help, Guru!: serialize/deserialize derived class between two application? Pin
Daniel Turini19-Sep-03 3:52
Daniel Turini19-Sep-03 3:52 
GeneralRe: Help, Guru!: serialize/deserialize derived class between two application? Pin
Anonymous19-Sep-03 7:09
Anonymous19-Sep-03 7:09 
GeneralRe: Help, Guru!: serialize/deserialize derived class between two application? Pin
Daniel Turini19-Sep-03 7:23
Daniel Turini19-Sep-03 7:23 
GeneralRichTextBoxes & Highlighting Pin
MrEyes18-Sep-03 6:24
MrEyes18-Sep-03 6:24 
GeneralRe: RichTextBoxes & Highlighting Pin
leppie19-Sep-03 7:16
leppie19-Sep-03 7:16 
GeneralRe: RichTextBoxes & Highlighting Pin
MrEyes19-Sep-03 16:02
MrEyes19-Sep-03 16:02 
GeneralRe: RichTextBoxes & Highlighting Pin
leppie19-Sep-03 16:08
leppie19-Sep-03 16:08 
Generalc# Marshalling unmanaged type char[xx] Pin
gmar18-Sep-03 5:14
gmar18-Sep-03 5:14 
So here is my problem :
i have a structure used as parameter (struct * )in a dll (VC++ 6.00):
typedef struct {
CHAR chararray1[10];
DWORD Data1;
DWORD Data2;
CHAR chararray2[4];
CHAR chararray3[2];
BYTE Data3;
BYTE Data4;
BYTE Data5;
BYTE Data6;
BYTE Data7;
BYTE Data8;
} mystruct;

It should be converted like this - i think Wink | ;-) ) -

[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]
unsafe public struct mystruct
{
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=10)]
public string chararray1;
public Int32 Data1;
public Int32 Data2;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=4)]
public string chararray2;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=2)]
public string chararray3;
public byte Data4;
public byte Data5; ...
}
Expected Value for string fields are "ABC : 0.00", "1234", "56"
When executing with size defined identically in both structures, i get this strange result "ABC Blush | :O .0","123", "5"
if i increase(+1) the size in C# structure , hoping to get my missing char, i get "ABC : 0.00", "1234", "6"

So am i doing a mistake somewhere ? or is it a bug ??????

Thanks by Advance

Gaetan

GeneralRe: c# Marshalling unmanaged type char[xx] Pin
Tym!18-Sep-03 9:37
Tym!18-Sep-03 9:37 
GeneralRe: c# Marshalling unmanaged type char[xx] Pin
gmar19-Sep-03 0:34
gmar19-Sep-03 0:34 
GeneralRe: c# Marshalling unmanaged type char[xx] Pin
gmar30-Sep-03 1:41
gmar30-Sep-03 1:41 
GeneralRe: c# Marshalling unmanaged type char[xx] Pin
leppie19-Sep-03 8:39
leppie19-Sep-03 8:39 
GeneralRe: c# Marshalling unmanaged type char[xx] Pin
gmar22-Sep-03 22:48
gmar22-Sep-03 22:48 
GeneralUnique Remote thread/context ID Pin
Dr Herbie18-Sep-03 3:31
Dr Herbie18-Sep-03 3:31 
GeneralRe: Unique Remote thread/context ID Pin
Arjan Einbu18-Sep-03 6:33
Arjan Einbu18-Sep-03 6:33 
GeneralRe: Unique Remote thread/context ID Pin
Dr Herbie18-Sep-03 22:30
Dr Herbie18-Sep-03 22:30 
GeneralClosing an MDI Child Form Pin
.gonad18-Sep-03 3:02
.gonad18-Sep-03 3:02 
GeneralRe: Closing an MDI Child Form Pin
.gonad18-Sep-03 3:37
.gonad18-Sep-03 3:37 
GeneralRe: Closing an MDI Child Form Pin
sumeat18-Sep-03 15:13
sumeat18-Sep-03 15:13 
GeneralScroll using keyboard on Printpreview control Pin
Subrat_Gaur17-Sep-03 22:08
Subrat_Gaur17-Sep-03 22:08 
GeneralPOP3 C# client having authentication problems when trying to retrieve emails from POP3 server Pin
silentweedhopper17-Sep-03 22:03
silentweedhopper17-Sep-03 22:03 
GeneralRe: POP3 C# client having authentication problems when trying to retrieve emails from POP3 server Pin
Steve S18-Sep-03 2:29
Steve S18-Sep-03 2:29 
GeneralRe: POP3 C# client having authentication problems when trying to retrieve emails from POP3 server Pin
MeisterBiber20-Sep-03 11:22
MeisterBiber20-Sep-03 11:22 
GeneralHaving trouble scrolling a RichTextBox Pin
Anonymous17-Sep-03 17:52
Anonymous17-Sep-03 17:52 
GeneralRe: Having trouble scrolling a RichTextBox Pin
J. Dunlap17-Sep-03 18:16
J. Dunlap17-Sep-03 18:16 

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.