Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How would you create this struct in C#?

7 views
Skip to first unread message

Toft

unread,
Feb 7, 2008, 4:00:38 PM2/7/08
to
I have a struct that I'm to create from the Parallax Tokenizer Library
so that I can use it with a web application, and I have no idea where
to start, I've been reading up on unsafe code and sequential, fixed
structs but I haven't had any luck.

(Example Struct from working code in C++ )


struct TModuleRec
{
bool Succeeded;
char *Error;
bool DebugFlag;
int TargetModule;
int TargetStart;
char *ProjectFiles[7];
int ProjectFilesStart[7];
char *Port;
int PortStart;
int LanguageVersion;
int LanguageStart;
int SourceSize;
int ErrorStart;
int ErrorLength;
char EEPROM[EEPROMSize];
int EEPROMFlags[EEPROMSize];
int VarCounts[4];
int PacketCount;
char PacketBuffer[(EEPROMSize/16*18)];
};

Any help would be more than appreciated, I'm still going to be playing
around with the unsafe code and see how lucky I get. Thanks again!

Toft

unread,
Feb 7, 2008, 4:58:26 PM2/7/08
to
On Feb 7, 1:00 pm, Toft <josht...@gmail.com> wrote:
> I have a struct that I'm to create from the Parallax Tokenizer Library
> so that I can use it with a web application, and I have no idea where
> to start, I've been reading up on unsafe code and sequential, fixed
> structs but I haven't had any luck.
>
> (Example Struct from working code in C++ )
>
> struct TModuleRec
> {
> bool Succeeded;
> char *Error;
> bool DebugFlag;
> int TargetModule;
> int TargetStart;
> char *ProjectFiles[7];
> int ProjectFilesStart[7];
> char *Port;
> int PortStart;
> int LanguageVersion;
> int LanguageStart;
> int SourceSize;
> int ErrorStart;
> int ErrorLength;
> char EEPROM[2048];
> int EEPROMFlags[2048];

> int VarCounts[4];
> int PacketCount;
> char PacketBuffer[(2304)];

> };
>
> Any help would be more than appreciated, I'm still going to be playing
> around with the unsafe code and see how lucky I get. Thanks again!

Some of the numbers I noticed I left as variables, here's something
that might clear things up.

0 new messages