Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Word frequency Pin
Michael Schubert11-Jul-08 2:38
Michael Schubert11-Jul-08 2:38 
QuestionConvert CString to int or float Pin
Trupti Mehta11-Jul-08 2:06
Trupti Mehta11-Jul-08 2:06 
AnswerRe: Convert CString to int or float Pin
CPallini11-Jul-08 2:18
mveCPallini11-Jul-08 2:18 
GeneralRe: Convert CString to int or float Pin
Trupti Mehta12-Jul-08 0:38
Trupti Mehta12-Jul-08 0:38 
GeneralRe: Convert CString to int or float Pin
CPallini12-Jul-08 2:40
mveCPallini12-Jul-08 2:40 
GeneralRe: Convert CString to int or float Pin
Trupti Mehta12-Jul-08 4:44
Trupti Mehta12-Jul-08 4:44 
GeneralRe: Convert CString to int or float Pin
CPallini13-Jul-08 7:21
mveCPallini13-Jul-08 7:21 
GeneralRe: Convert CString to int or float Pin
Trupti Mehta14-Jul-08 1:04
Trupti Mehta14-Jul-08 1:04 
Hello,

Thanks. I tried the following way :
   CString csValue;
   GetDlgItem(IDC_PRICE_EDIT)->GetWindowText(csValue);
.....
       char* dest;
       WideCharToMultiByte(CP_ACP, 0, csValue, -1, dest, 10, NULL, NULL);
       float flt = (float)atof(dest);
       CString d(_T("Converted Float:"));
       d.Format(_T("%s %.2f"), d, flt);
       AfxMessageBox(d);


Using WideCharToMultiByte method, I put all values accordingly & converted to float using atof. I get the converted value. BUT as soon as the Converted .. msg box is displayed I also get "Assertion Failed!" :File thrdcore.cpp, Line 867 Abort/Ret/Ig. Retry or ignore doesn't respond so I have to select Abort. It points to
if (m_nDisablePumpCount != 0)
{
TRACE0("Error: CWinThread::PumpMessage called when not permitted.\n");
--------> ASSERT(FALSE);
}
of PumpMessage().

Where am aI going wrong can you point out? Do I need to change anything in Wide...(). AS dest is not initialized, I get warning message for that also.

I have also noted that in eVC++4 I get exceptions at Assert many times, any special reason?

Thanks

Terry

GeneralRe: Convert CString to int or float Pin
CPallini14-Jul-08 1:47
mveCPallini14-Jul-08 1:47 
GeneralRe: Convert CString to int or float Pin
Trupti Mehta14-Jul-08 3:35
Trupti Mehta14-Jul-08 3:35 
AnswerRe: Convert CString to int or float Pin
killabyte11-Jul-08 2:32
killabyte11-Jul-08 2:32 
GeneralOT Pin
CPallini11-Jul-08 2:53
mveCPallini11-Jul-08 2:53 
GeneralRe: OT Pin
killabyte11-Jul-08 2:57
killabyte11-Jul-08 2:57 
JokeRe: OT Pin
SandipG 11-Jul-08 3:07
SandipG 11-Jul-08 3:07 
QuestionRe: Convert CString to int or float Pin
David Crow11-Jul-08 2:55
David Crow11-Jul-08 2:55 
AnswerRe: Convert CString to int or float Pin
Mark Salsbery11-Jul-08 5:46
Mark Salsbery11-Jul-08 5:46 
QuestionCFile Vs CStdioFile Pin
nisha0000011-Jul-08 1:38
nisha0000011-Jul-08 1:38 
AnswerRe: CFile Vs CStdioFile Pin
CPallini11-Jul-08 1:49
mveCPallini11-Jul-08 1:49 
AnswerRe: CFile Vs CStdioFile Pin
Varghese Paul M11-Jul-08 1:50
Varghese Paul M11-Jul-08 1:50 
QuestionControl Panel Pin
shakils11-Jul-08 0:55
shakils11-Jul-08 0:55 
QuestionRe: Control Panel Pin
David Crow11-Jul-08 2:56
David Crow11-Jul-08 2:56 
AnswerRe: Control Panel Pin
shakils14-Jul-08 3:04
shakils14-Jul-08 3:04 
GeneralRe: Control Panel Pin
David Crow14-Jul-08 8:18
David Crow14-Jul-08 8:18 
GeneralRe: Control Panel Pin
shakils17-Jul-08 2:44
shakils17-Jul-08 2:44 
Questionload a bitmap to Picture Box from a path in database field Pin
Waguih11-Jul-08 0:37
Waguih11-Jul-08 0:37 

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.