Bonjour,
J'ai crée une DLL avec une fonction, qui affiche plusieurs fois la même chaîne, une fois en tant que char *, une fois en tant que CString * puis en CString.
En char * tout est OK, mais CString et CString *, il m'affiche un code hexa (l'adresse du pointeur?).
Cette fonction marche très bien dans un programme "normal", mais dans une DLL... juste le char * qui marche.
Note : j'ai essayé d'afficher **test2 ou *test3, toujours une chaîne hexa... Idem pour test2->GetBuffer() et test.GetBuffer()
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 void afficherMsg() { char * test = "ceci est un test"; CString * test2 = new CString(); *test2 = "ceci est un test"; CString test3 = "ceci est un test"; cout<<"char * : "<<test<<endl; cout<<"CString * : "<<*test2<<endl; cout<<"CString : "<<test3<<endl; delete test; delete test2; }
Si quelqu'un a une idée...
Merci
A+
![]()
Partager