Passing complex structure from C# to C++ and back

From: Ofir (ofirsh_at_hotmail.com)
Date: 02/26/04


Date: 25 Feb 2004 16:55:04 -0800

Hi,

I am currently using an external C++ library using C++ code, and I
would like to continue using this library from C# code I am writing.I
do not have access to the sources of this library.
I was looking around, and most of the information I found deals with
simpler cases. I could hardly find any meterial regarding the pointer
to pointer structure, as in "prop **x".

My question is what data structure, marshaling or code do I have to
write in order to fill correctly the following data structure being
sent to the function and returned from it ?

The C++ structures are:

struct prop
{
  int i;
  double v;
}

struct container
{
  int l; // number of elements
  double *y;
  prop **x;
}

struct results
{
  prop **x;
}

The prototype of the function is:

results *compute( container *cont )

Thank you in advance,

Ofir



Relevant Pages

  • Re: [C++] Help Parsing an Integer/Character Mix
    ... - What kind of data structure are you using? ... int Number; ... while(InFile>> Buffer) ... possible even an member function. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: large file support
    ... FileHeader::Allocate(BitMap *freeMap, int fileSize) ... describing where on disk to find all of the data in the file. ... // The file header data structure can be stored in memory or on disk. ...
    (comp.lang.cpp)
  • Re: passing structures among functions
    ... "Header files should only contain declarations." ... It also defines for the data structure at the ... int get_data ...
    (comp.lang.c)
  • Re: Cross tabulation - someone please help if you can
    ... > I need advise re the best data structure to use for representing data ... final int grad; ... YearStats(int maj, int grad, int nota) { ...
    (comp.lang.java.help)
  • Re: pass an array throuh a function
    ... In message, Ben Cottrell ... > int minutes; ... >So now, you have a data structure called clock, which has 3 properties ...
    (alt.comp.lang.learn.c-cpp)