Hello guru's,
Please help me out in the following:
How must I write the code in C# to cope with the following
legacy-struct:
typedef struct callback
{
FILE* stream;
char buffer [1024];
}
I've been trying to use the following, to no avail:
[StructLayout(LayoutKind.Sequential)]
public struct CBinfo
{
public IntPtr stream;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1024)]
public byte[] buffer;
}
I guess the IntPtr can't 'marshal' the complete FILE-structure:
(char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;)
Please advise me with some code examples.
("one line of code equals a hundred words...")
Thanks for your time.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!