Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi... I want to ask, how to convert CString data to short(not unsigned short).
I use MFC. thx
Posted

Do you mean you have a number stored in a string and want to get its numerical value?

If so, take a look at strtol[^] and atoi[^]. Just cast these down to a short (and check to make sure the number is between -32768 and 32767.
 
Share this answer
 
yes, I do. I want get value from the combo box to use in Microsoft communication.

Thank for your help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900