convert CString to unsigned short
-
hi CString str = "000001"; unsigned short st =_com_util::ConvertStringToBSTR(str); st = 0x00000 is coming... please help any body..
-
hi CString str = "000001"; unsigned short st =_com_util::ConvertStringToBSTR(str); st = 0x00000 is coming... please help any body..
If you dont bother to get the value in unsigned long then strtoul, wcstoul can be used[^].
Member 3653751 wrote:
unsigned short st =_com_util::ConvertStringToBSTR(str);
Well your code is not seems to be correct. It convert the LPTSTR to BSTR, it wont convert it to unsigned short :)
Величие не Бога может быть недооценена.
-
hi CString str = "000001"; unsigned short st =_com_util::ConvertStringToBSTR(str); st = 0x00000 is coming... please help any body..
-
If you dont bother to get the value in unsigned long then strtoul, wcstoul can be used[^].
Member 3653751 wrote:
unsigned short st =_com_util::ConvertStringToBSTR(str);
Well your code is not seems to be correct. It convert the LPTSTR to BSTR, it wont convert it to unsigned short :)
Величие не Бога может быть недооценена.
hi convertStringtoBSTR() this function is returning unsigned short only... i am giving correct input....but output is coming worning.... please help.... actual my problem is i have vb dll... Public Function f1(SendString As String) As String after loading vb dll t is the class pointer of vb dll... CString str = "000001"; unsigned short *stemp = _com_util::ConvertStringToBSTR(str); //stemp = 48 means 0 t->f1(&stemp) input / output unsigned short its showing...
-
hi convertStringtoBSTR() this function is returning unsigned short only... i am giving correct input....but output is coming worning.... please help.... actual my problem is i have vb dll... Public Function f1(SendString As String) As String after loading vb dll t is the class pointer of vb dll... CString str = "000001"; unsigned short *stemp = _com_util::ConvertStringToBSTR(str); //stemp = 48 means 0 t->f1(&stemp) input / output unsigned short its showing...