Bonjour,

J'ai besoin de convertir un String^ en const unsigned short * à des fins de manipulations de chemin de répertoire.

L'encodage est en unicode. Le code suivant passe au compilateur mais ne me convertit pas la chaine.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
 
IntPtr tmp = System::Runtime::InteropServices::Marshal::StringToHGlobalANSI(chaine);
const unsigned short * nomConvert = (unsigned short *)tmp.ToPointer();
Comment faire?