Click here to Skip to main content
15,908,166 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Edit Control Pin
Trupti Mehta5-Jun-08 21:50
Trupti Mehta5-Jun-08 21:50 
GeneralRe: Edit Control Pin
Alan Balkany6-Jun-08 3:15
Alan Balkany6-Jun-08 3:15 
AnswerRe: Edit Control Pin
toxcct5-Jun-08 0:02
toxcct5-Jun-08 0:02 
AnswerRe: Edit Control Pin
Rajesh R Subramanian5-Jun-08 0:15
professionalRajesh R Subramanian5-Jun-08 0:15 
AnswerRe: Edit Control Pin
sudhir_Kumar5-Jun-08 0:33
sudhir_Kumar5-Jun-08 0:33 
AnswerRe: Edit Control Pin
sudhir_Kumar5-Jun-08 0:35
sudhir_Kumar5-Jun-08 0:35 
AnswerRe: Edit Control Pin
James R. Twine5-Jun-08 1:11
James R. Twine5-Jun-08 1:11 
GeneralRe: Edit Control Pin
Trupti Mehta5-Jun-08 4:21
Trupti Mehta5-Jun-08 4:21 
Thanks James. But still not to the mark. Actually I want to convert CString to int. So, based on your hint, I opted to use strtol and then cast it to int, as i didn't find any method that converts strtoi.

CString csValue;
GetDlgItem(IDC_OpNo_EDIT)->GetWindowText( csValue );   // Get the value of text box
LPTSTR p = csValue.GetBuffer(10);    // NEED THIS TO CONVERT TO CHAR* TO USE IN strtol
char* stopString;

long l = strtol(p, stopString, 9);  // GET ERROR DUE TO lptsrt & NOT CHAR*
csValue.ReleaseBuffer();
double d = atof((LPCTSTR)csValue);


The error is :
: error C2664: 'strtol' : cannot convert parameter 1 from 'unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.

atof also gives the same error.

aNY WAY to convert LPTSTR ot CString to char*, TCHAR* or wCHAR*.

Thanks

Terry

GeneralRe: Edit Control Pin
James R. Twine5-Jun-08 6:47
James R. Twine5-Jun-08 6:47 
AnswerRe: Edit Control Pin
David Crow5-Jun-08 2:45
David Crow5-Jun-08 2:45 
QuestionQuestion on accessing variable within innerblock? Pin
Super Hornet4-Jun-08 23:54
Super Hornet4-Jun-08 23:54 
AnswerRe: Question on accessing variable within innerblock? Pin
toxcct5-Jun-08 0:00
toxcct5-Jun-08 0:00 
AnswerRe: Question on accessing variable within innerblock? Pin
CPallini5-Jun-08 0:11
mveCPallini5-Jun-08 0:11 
AnswerRe: Question on accessing variable within innerblock? Pin
sudhir_Kumar5-Jun-08 0:29
sudhir_Kumar5-Jun-08 0:29 
AnswerRe: Question on accessing variable within innerblock? Pin
Nibu babu thomas5-Jun-08 0:58
Nibu babu thomas5-Jun-08 0:58 
AnswerRe: Question on accessing variable within innerblock? Pin
Eytukan5-Jun-08 1:58
Eytukan5-Jun-08 1:58 
AnswerRe: Question on accessing variable within innerblock? Pin
Rajesh R Subramanian5-Jun-08 2:46
professionalRajesh R Subramanian5-Jun-08 2:46 
GeneralRe: Question on accessing variable within innerblock? Pin
Super Hornet5-Jun-08 6:33
Super Hornet5-Jun-08 6:33 
QuestionHow to create pages in Dialog box plz help Pin
Member 46556854-Jun-08 23:13
Member 46556854-Jun-08 23:13 
AnswerRe: How to create pages in Dialog box plz help Pin
toxcct4-Jun-08 23:16
toxcct4-Jun-08 23:16 
GeneralRe: How to create pages in Dialog box plz help Pin
Member 46556854-Jun-08 23:25
Member 46556854-Jun-08 23:25 
GeneralRe: How to create pages in Dialog box plz help Pin
toxcct4-Jun-08 23:27
toxcct4-Jun-08 23:27 
QuestionRe: How to create pages in Dialog box plz help Pin
CPallini4-Jun-08 23:18
mveCPallini4-Jun-08 23:18 
AnswerRe: How to create pages in Dialog box plz help Pin
Member 46556854-Jun-08 23:40
Member 46556854-Jun-08 23:40 
GeneralRe: How to create pages in Dialog box plz help Pin
Hamid_RT4-Jun-08 23:56
Hamid_RT4-Jun-08 23:56 

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.