Information générale
Catégorie:
Fonctions Windows API
I'm pretty sure that when you send a CString as parameter for a char pointer (as in the case of strcpy), the LPTSTR operator is applied by default by VC++. Doing a trace in such code shows that previous entering the function, the parameter is send to the LPTSTR operator. But I didn't tested this once again right now...
I believe that when a dll function returns a CString, the conversion must be done by the caller (VFP in this case), etc.
Vlad
>Internally the CString is still just a char memory buffer with stored length. The online VC++ docs show it can be substituted for C char arrays. Since you can send it as the source to strcpy() that pretty much says it works the same. I think the crashing is simply related to a memory allocation issue.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement