Bonjour,
Selon toutes les sources que j'ai pu voir, ça devrait être correct:
<!-- BEGIN TEMPLATE: bbcode_code -->
char *ptr,temp[MAX_LOADSTRING];
CString strValue;
ptr = temp;
... CODE ...
if (strValue.GetLength()>0) {
SendMessage(hEdtT,EM_SETSEL,TextLen,TextLen); // Placer le curseur à la fin
SendMessage(hEdtT,EM_REPLACESEL,0,(LPARAM)(LPCTSTR)strValue); // Ecrit le texte
TextLen += strValue.GetLength();
/*WideCharToMultiByte(CP_ACP,0,strValue,-1,temp,wcslen(strValue)+1,NULL,NULL); // CString->char
strValue.Format(L">%s<",temp);
SendMessage(hEdtT,EM_SETSEL,TextLen,TextLen); // Placer le curseur à la fin
SendMessage(hEdtT,EM_REPLACESEL,0,(LPARAM)(LPCTSTR)strValue); // Ecrit le texte
TextLen += strValue.GetLength(); // */
}
Le premier affichage marche bien tout seul, mais dès que je met le reste du code (ce qui est commenté) ça pête (pleins de caractères bizzares) !
Pourquoi ça ne marche pas ?
David, à VERSAILLES
http://www.gentag.fr