essayons...
[DllImport("C:\\siemens\\Srv_tgc\\inttgc_dll.dll", CharSet=CharSet.Ansi)]
public unsafe static extern int ComTGCEcrire(long taillemessage, char* message);
private void blabla(string text) {
// on transforme le string en char[]
char[] bla = text.ToCharArray();
unsafe {
ComTGCEcrire( bla.Length, *bla );
}
}
ne pas oublier d'activer le code unsafe dans les options de compilation du projet.
Sébastien FERRAND
[MVP C#]