Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: marshalling Pin
grv57511-Jun-03 11:54
grv57511-Jun-03 11:54 
GeneralRe: marshalling Pin
leppie11-Jun-03 12:22
leppie11-Jun-03 12:22 
GeneralRe: marshalling Pin
grv57511-Jun-03 12:42
grv57511-Jun-03 12:42 
GeneralDetect if MAPI.Session is installed Pin
AndyLatham10-Jun-03 20:51
AndyLatham10-Jun-03 20:51 
GeneralRe: Detect if MAPI is installed Pin
AndyLatham10-Jun-03 22:05
AndyLatham10-Jun-03 22:05 
GeneralTreeview Pin
Shotgun10-Jun-03 16:29
Shotgun10-Jun-03 16:29 
GeneralRe: Treeview Pin
shaunAustin10-Jun-03 22:19
shaunAustin10-Jun-03 22:19 
QuestionHow to read file into a structure? Pin
Member 14701010-Jun-03 15:17
Member 14701010-Jun-03 15:17 
Hi All,

How to read file into a structure? The file is created by VC++ 6.0.

For example:
VC++ Code:

struct MyStruct
{
short a;
int b;
char c[20];
short d;
};

CFile aFile;
...
MyStruct aStrcut;
aStruct.a = 1;
...
aFile.Write(&aStruct, sizeof(MyStruct));


I'd like to read the file into the following struct in C#, how? please advice.

[StructLayout(LayoutKind.Sequential, Pack=1)]
struct MyStruct
{
public short a;
public int b;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)]
public string c;
public short d;
};

GeneralUpload/download monitoring. Pin
PrebKlok10-Jun-03 7:39
PrebKlok10-Jun-03 7:39 
GeneralRe: Upload/download monitoring. Pin
David Stone10-Jun-03 7:53
sitebuilderDavid Stone10-Jun-03 7:53 
GeneralRe: Upload/download monitoring. Pin
PrebKlok10-Jun-03 8:01
PrebKlok10-Jun-03 8:01 
GeneralControl Transparency Pin
CSharpDavid10-Jun-03 7:05
CSharpDavid10-Jun-03 7:05 
GeneralRe: Control Transparency Pin
CSharpDavid10-Jun-03 7:15
CSharpDavid10-Jun-03 7:15 
GeneralC# and Active Directory Pin
IsaacB10-Jun-03 6:26
IsaacB10-Jun-03 6:26 
GeneralRe: C# and Active Directory Pin
David Stone10-Jun-03 7:11
sitebuilderDavid Stone10-Jun-03 7:11 
GeneralRe: C# and Active Directory Pin
shaunAustin11-Jun-03 5:47
shaunAustin11-Jun-03 5:47 
GeneralOffice Dll Icons Pin
Kant10-Jun-03 4:10
Kant10-Jun-03 4:10 
GeneralRe: Office Dll Icons Pin
Kannan Kalyanaraman10-Jun-03 6:53
Kannan Kalyanaraman10-Jun-03 6:53 
GeneralRe: Office Dll Icons Pin
Kant10-Jun-03 7:23
Kant10-Jun-03 7:23 
GeneralRe: Office Dll Icons Pin
Kant10-Jun-03 8:17
Kant10-Jun-03 8:17 
GeneralRe: Office Dll Icons Pin
leppie10-Jun-03 9:20
leppie10-Jun-03 9:20 
GeneralRemoving padding from buttons... Pin
kevinrc10-Jun-03 3:50
kevinrc10-Jun-03 3:50 
GeneralRe: Removing padding from buttons... Pin
kevinrc11-Jun-03 3:11
kevinrc11-Jun-03 3:11 
GeneralQuestion on clipping... Pin
Weiye Chen10-Jun-03 3:24
Weiye Chen10-Jun-03 3:24 
GeneralRe: Question on clipping... Pin
Weiye Chen10-Jun-03 17:52
Weiye Chen10-Jun-03 17:52 

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.