jchoplin
Messages postés12Date d'inscriptionmardi 9 novembre 2004StatutMembreDernière intervention16 mars 2006
-
16 mars 2006 à 17:16
Lutinore
Messages postés3246Date d'inscriptionlundi 25 avril 2005StatutMembreDernière intervention27 octobre 2012
-
16 mars 2006 à 19:25
Bonjour,
j'ai converti une structure de C en C# de la manière suivante:
struct PLparmRec {
short wVersion; // version of this structure
short action;
long message;
short resultat;
HWND theWindow;
POINT wOrigin;
POINT wSize;
void FAR *theEvent;
void FAR *theText;
long textOffset;
long textSize;
long miscellaneous;
};
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PLparmRec
{
public Int16 wVersion; // version of this structure
public Int16 action;
public Int32 message;
public Int16 resultat;
public IntPtr theWindow;
public Point wOrigin;
public Point wSize;
public IntPtr theEvent;
public IntPtr theText;
public Int32 textOffset;
public Int32 textSize;
public Int32 miscellaneous;
};
Il semble cependant que ma conversion ne soit pas juste car lorsque je passe cette structure en paramètre de ma fonction C d'une dll qui me le demande, j'ai des résultats assez bizarre. Comment savoir où ça ne va pas dans ma conversion (d'après les observations que j'ai pu faire, c'est vaiment là que ça semble coincer).
Merci beaucoup d'avance