Domanda

Come posso convertire l'interoperatività tra un array c ++ / CLI e un array c ++ nativo E VICE VERSA.

array ^ Cpluspluss_CLI_ManagedArray;

unsigned char * UnmanagedArray;

Ho trovato System :: Runtime :: InteropServices :: Marshal; (IntPtr) ci sono così tante informazioni per un primo timer come me (alla CLI) Quindi non sono sicuro su quale usare.

Grazie

Raj

È stato utile?

Soluzione

// non gestito per gestito ...

IntPtr ptr ((unsigned char *) UnmanagedArray);

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

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

// non gestito per gestito ... Vedi questo post

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top