Advertisement

06.25.2008 at 12:42PM PDT, ID: 23515907
[x]
Attachment Details

MFC/C++: convert combo box entry to cstring / int

Asked by Fippy_Darkpaw in Windows MFC Programming, C++ Programming Language

Tags: mfc, c++

I need to convert the currently selected item from a combo box into a cstring, int, and float. What's the best way?

For example,

      int selectedIndex = myComboBox.GetCurSel();

      // convert to string, int, and float, these don't work
      CString dataString   =   myComboBox.GetItemData(selectedIndex);
      int dataInt   =   myComboBox.GetItemData(selectedIndex);
      float dataFloat   =   myComboBox.GetItemData(selectedIndex); Start Free Trial
 
 
[+][-]06.25.2008 at 01:07PM PDT, ID: 21869374

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows MFC Programming, C++ Programming Language
Tags: mfc, c++
Sign Up Now!
Solution Provided By: Darrylsh
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.25.2008 at 01:12PM PDT, ID: 21869420

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.28.2008 at 02:42AM PDT, ID: 21890002

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906