Marshalling C struct en C#
Bonjour.
Je suis en train d'appeler une dll écrite en C dans du C#. Hors j'ai un problème au niveau d'une des structs.
En C:
Code:
1 2 3 4 5 6 7 8 9
|
typedef struct _TCurve
{
int fNumItems; /* Number of TRatePts in fArray */
TRatePt *fArray; /* Dates & rates */
TDate fBaseDate; /* Discount date */
double fBasis; /* Number compounding periods / year */
long fDayCountConv; /* How the year fraction is computed */
} TCurve; |
J'ai tenté ca:
Code:
1 2 3 4 5 6 7 8 9 10
|
public struct TCurve
{
public int fNumItems; /* Number of TRatePts in fArray */
public ref TRatePt fArray; /* Dates & rates */
public TDate fBaseDate; /* Discount date */
public double fBasis; /* Number compounding periods / year */
public long fDayCountConv; /* How the year fraction is computed */
//public void *fClassHandle; /* C++ class handle implementation */
}; |
mais je peux pas declarer TRatePt comme ref...
En gros comment je fait pour le pointeur sur TRatePt ? TRatePt est defini ainsi:
Code:
1 2 3 4 5 6
|
typedef struct
{
TDate fDate;
double fRate;
} TRatePt; |
Merci d'avance