Re: trying to port some C++ structures to C# problem.

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Willy Denoyette [MVP] (willy.denoyette_at_pandora.be)
Date: 11/12/04


Date: Fri, 12 Nov 2004 12:17:51 +0100

This is what I was afraid of ;-)
You can't map a managed struct/class to a buffer (probably a byte array) to
without copying ( part of) the buffer to an instance of that struct/class.
So I'm not clear as to what you mean with "What I do is to load the complete
file in memory, then maps a structure to...", does this mean you are DOING
this, or that you would LIKE to DO...

Willy.

"Olaf Baeyens" <olaf.baeyens@skyscan.be> wrote in message
news:41949591$0$30451$ba620e4c@news.skynet.be...
>> But again I'm not sure this is what you want, therefore I asked why you
>> needed the size of the struct.
>>
> Wel I have a binary STL file that contains a header and then a lot of 3D
> triangles.
> What I do is to load the complete file in memory, then maps a structure to
> the header and if that structure is correct then I map another STLFACET
> structure for every triangle.
>
> It is code that is needed for my OpenGL visualization stuff, and since the
> original data files can be huge, I try to avoid copying as much as I can.
> Managed code is perfect for 3D modelling stuff. No more tracking of who
> created the object and who should delete it. Wonderfull. :-)
>
> This STL parser is only the beginning part, I try to create the technology
> to parse any potentional binary file formats (bmp, tiff, jpg,...) that I
> might encounter.
> I want to create a code base for this.
>
> --
> http://www.skyscan.be
>
>



Relevant Pages