Data Type conversion.
-
Can u tell a method to convert unsigned short* to CString ?? Thanx in advance. Rgds Sunil
-
Can u tell a method to convert unsigned short* to CString ?? Thanx in advance. Rgds Sunil
-
That depend on what data type pointed by unsigned short*, etc. string, wide char string number ..., and what string representation you want. ;)
Can u explain??
-
Can u explain??
-
Can u tell a method to convert unsigned short* to CString ?? Thanx in advance. Rgds Sunil
If the unsigned short * is really a
BSTR
or a_bstr_t
then just doCString(usp)
. The CString constructor is overloaded to acceptBSTR
s
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
-
You asking "how convert pointer to string", or "how convert data ref by pointer to string" ? And if data, you mast say what kind of data ;) (
unsigned short *
pointer may point to Unicode string, WORD value, 16bpp raster data ;) ....)It is pointer to a Ascci string. I have to display it in a message box. So I have to convert it to CString.
-
It is pointer to a Ascci string. I have to display it in a message box. So I have to convert it to CString.
-
I got only the first letter???
-
I got only the first letter???
-
That meens, that you have not ASCII data stored by pointer. You mast know, what coding used (Unicode, MBS, BSTR, wide char), and corectly convert pointer to CString constructor.
Sorry I mistook . It is pointed to BSTR.
-
Sorry I mistook . It is pointed to BSTR.
-
It is pointer to a Ascci string. I have to display it in a message box. So I have to convert it to CString.
Neither
MessageBox()
norAfxMessageBox()
requires aCString
object. You might consider showing us a relevant code snippet and we could probably offer a solution.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
-
It works!!!!!!! Thanx a lot..