dllimport changer un string en dword et un dword en string
bonjour,
voila, je communique avec une dll via des structure c (que je converti en csharp).
dans une des structures (coté client) en c, j'ai ceci
qui est le pointeur sur les data (il y a aussi un len pour dire la longueur)
j'ai traduit en csharp par par
Code:
1 2 3
|
string text = "flksjkdflkj";
data = (UInt32)Marshal.StringToHGlobalAnsi(text).ToInt32(); |
de l'autre coté de l'application, coté server
je recoit ce Data dword qu'en csharp, j'ai converti en UInt32
qui est un pointeur sur le string
comment faire pour changer ce dword en string??
j'ai essayer
Code:
1 2 3
|
IntPtr ptr = new IntPtr(data);
Marshal.PtrToStringAnsi(ptr) |
mais cela ne fonctionne pas
salutation
merci