Question

Comment puis-je convertir l'interopérabilité entre un tableau c ++ / CLI et un tableau c ++ natif AND VICE VERSA.

array ^ Cpluspluss_CLI_ManagedArray;

caractère non signé * UnmanagedArray;

J'ai trouvé le System :: Runtime :: InteropServices :: Marshal; (IntPtr) Il y a tellement d’informations pour un premier chronométreur comme moi (à CLI). Je ne suis donc pas sûr de celle à utiliser.

Merci

Raj

Était-ce utile?

La solution

// non géré à géré ...

IntPtr ptr ((unsigned char *) UnmanagedArray);

tableau < Byte > ^ Cpluspluss_CLI_ManagedArray = gcnew array (UnmanagedArrayLength);

Marshal :: Copy (ptr, Cpluspluss_CLI_ManagedArray, 0, UnmanagedArrayLength);

// non géré à géré ... Voir cet article

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top