Click here to Skip to main content
15,891,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Please help with CString to float. Pin
Jochum Wittebrood10-Oct-04 11:07
Jochum Wittebrood10-Oct-04 11:07 
GeneralRe: Please help with CString to float. Pin
Christian Graus10-Oct-04 11:54
protectorChristian Graus10-Oct-04 11:54 
GeneralRe: Please help with CString to float. Pin
Jochum Wittebrood10-Oct-04 14:32
Jochum Wittebrood10-Oct-04 14:32 
GeneralRe: Please help with CString to float. Pin
Christian Graus10-Oct-04 14:41
protectorChristian Graus10-Oct-04 14:41 
GeneralRe: Please help with CString to float. Pin
Michael Dunn10-Oct-04 14:49
sitebuilderMichael Dunn10-Oct-04 14:49 
GeneralRe: Please help with CString to float. Pin
toxcct10-Oct-04 21:00
toxcct10-Oct-04 21:00 
GeneralRe: Please help with CString to float. Pin
callisthenes11-Oct-04 3:57
callisthenes11-Oct-04 3:57 
GeneralRe: Please help with CString to float. Pin
Jochum Wittebrood12-Oct-04 12:43
Jochum Wittebrood12-Oct-04 12:43 
Thanks for all your help guys, but I tried all the functions that you suggested and they all require 'const char' where the CString seems to be 'unsigned short'. The compiler always gives me convertion errors...

It must be my VB background but I can't seem to get my head around this, while people must use it in code all the time. Does anyone have a small snippit of code to show me how they do it?

This is what I've got...

int ListIndex;
CString WorkingStr;
CString TempStr;
float TAG;

CListBox * List1=(CListBox *)GetDlgItem(IDC_LIST1);

ListIndex = List1->GetCurSel();

List1->GetText(ListIndex,WorkingStr);

TempStr = WorkingStr.Mid(54,8);

TAG = atof(TempStr);

So we know that last line is the problem, but what can I do to fix it?

Thanks for your help.

Jochum

GeneralRuntime ComboBox Question Pin
otrcomm10-Oct-04 9:04
otrcomm10-Oct-04 9:04 
GeneralRe: Runtime ComboBox Question Pin
Antti Keskinen10-Oct-04 9:23
Antti Keskinen10-Oct-04 9:23 
GeneralRe: Runtime ComboBox Question Pin
otrcomm10-Oct-04 12:03
otrcomm10-Oct-04 12:03 
GeneralRe: Runtime ComboBox Question - Never Mind Pin
otrcomm10-Oct-04 12:56
otrcomm10-Oct-04 12:56 
GeneralRe: Runtime ComboBox Question Pin
toxcct10-Oct-04 21:10
toxcct10-Oct-04 21:10 
QuestionHow l Pin
lordmickel10-Oct-04 8:48
lordmickel10-Oct-04 8:48 
AnswerRe: How l Pin
Christian Graus10-Oct-04 8:54
protectorChristian Graus10-Oct-04 8:54 
GeneralRe: How l Pin
lordmickel10-Oct-04 9:21
lordmickel10-Oct-04 9:21 
GeneralRe: How l Pin
Christian Graus10-Oct-04 9:30
protectorChristian Graus10-Oct-04 9:30 
GeneralRe: How l Pin
lordmickel11-Oct-04 7:59
lordmickel11-Oct-04 7:59 
GeneralRe: How l Pin
Christian Graus11-Oct-04 10:19
protectorChristian Graus11-Oct-04 10:19 
AnswerRe: How l Pin
Antti Keskinen10-Oct-04 8:56
Antti Keskinen10-Oct-04 8:56 
GeneralRe: How l Pin
lordmickel10-Oct-04 9:23
lordmickel10-Oct-04 9:23 
AnswerRe: How l Pin
Paul Ranson11-Oct-04 10:55
Paul Ranson11-Oct-04 10:55 
GeneralRe: How l Pin
lordmickel13-Dec-04 10:41
lordmickel13-Dec-04 10:41 
Generalsystem info Pin
Lanre Ogunkola10-Oct-04 6:35
Lanre Ogunkola10-Oct-04 6:35 
GeneralRe: system info Pin
Ravi Bhavnani10-Oct-04 7:09
professionalRavi Bhavnani10-Oct-04 7:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.