Click here to Skip to main content
15,903,523 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CWinThread Pin
king_of_the_world15-Feb-03 15:17
king_of_the_world15-Feb-03 15:17 
GeneralRe: CWinThread Pin
Gary R. Wheeler16-Feb-03 4:33
Gary R. Wheeler16-Feb-03 4:33 
GeneralHelp with subclassing Pin
paully15-Feb-03 13:25
paully15-Feb-03 13:25 
GeneralUsing The Replace feature in Visual c++6 Pin
ZAkinG15-Feb-03 13:04
ZAkinG15-Feb-03 13:04 
GeneralCComboBox and appWizard Pin
king_of_the_world15-Feb-03 12:58
king_of_the_world15-Feb-03 12:58 
GeneralRe: CComboBox and appWizard Pin
DuFF15-Feb-03 15:13
DuFF15-Feb-03 15:13 
GeneralRe: CComboBox and appWizard Pin
king_of_the_world15-Feb-03 15:18
king_of_the_world15-Feb-03 15:18 
GeneralConvert CString Long, cant, help? (Newbie) Pin
PocketBlast15-Feb-03 11:25
PocketBlast15-Feb-03 11:25 
As the sig says, Im new to this entire game! Im not only learning VC++, but the IDE to boot! Gosh.. Gimme some Tylenol!! Smile | :)

Ive got a string variable, Number1, I want to convert it Long, but the linker give the message:

error C2664: 'strtol' : cannot convert parameter 1 from 'class CString' to 'const char *'

Heres the code snippit:
===========================================================
GetDlgItemText(IDC_EDIT1, Number1);
GetDlgItemText(IDC_EDIT2, Number2);

CString TmpTxt = "The numbers are " + Number1 + " and " + Number2;

MessageBox( TmpTxt, _T("Error"), MB_ICONINFORMATION | MB_OK);

// Everything above works fine, below is conversion
// which wont work.

long Ans;
Ans = strtol(Number1, NULL, 10);
===========================================================

This is a stupid newbie project, enter two numbers in two Edit Boxes, convert the text var to a long var, add the two, convert it back to text and give a message box with the sum of the two.

I have the Member Variable assigned to IDC_EDIT1 as CString using Number1, and 2 respectively.

I am using eVC++ 3.0 for WinCE. Smile | :)

Any help, thanks much in advance!

This *aint* VB, dats fur sure!

PS
Please reply as if I were a total idiot, becaue I am! Roll eyes | :rolleyes:

Andrew



New to VC++ programming, working hard to learn. Smile | :)
GeneralRe: Convert CString Long, cant, help? (Newbie) Pin
Michael A. Barnhart15-Feb-03 11:36
Michael A. Barnhart15-Feb-03 11:36 
GeneralRe: Convert CString Long, cant, help? (Newbie) Pin
Michael Dunn15-Feb-03 11:53
sitebuilderMichael Dunn15-Feb-03 11:53 
QuestionParsing US date/time using COleDateTime ??? Pin
Anonymous15-Feb-03 10:36
Anonymous15-Feb-03 10:36 
AnswerRe: Parsing US date/time using COleDateTime ??? Pin
Abin15-Feb-03 14:04
Abin15-Feb-03 14:04 
GeneralRe: Parsing US date/time using COleDateTime ??? Pin
Anonymous15-Feb-03 23:41
Anonymous15-Feb-03 23:41 
GeneralCreating structure for XML data Pin
15-Feb-03 10:31
suss15-Feb-03 10:31 
GeneralLinked List HELP!. Pin
Sal R.15-Feb-03 8:55
Sal R.15-Feb-03 8:55 
GeneralRe: Linked List HELP!. Pin
AlexO15-Feb-03 9:14
AlexO15-Feb-03 9:14 
GeneralLPSTREAM and CString Pin
Member 9615-Feb-03 8:52
Member 9615-Feb-03 8:52 
GeneralRe: LPSTREAM and CString Pin
AlexO15-Feb-03 9:09
AlexO15-Feb-03 9:09 
GeneralRe: LPSTREAM and CString Pin
peterchen15-Feb-03 10:25
peterchen15-Feb-03 10:25 
QuestionHow to Kill Fliker on CDialog? Pin
Michael_Russia15-Feb-03 7:52
sussMichael_Russia15-Feb-03 7:52 
QuestionUn-caught exception - how do I pin it down ? Pin
Still learning how to code15-Feb-03 7:45
Still learning how to code15-Feb-03 7:45 
AnswerRe: Un-caught exception - how do I pin it down ? Pin
Chris Losinger15-Feb-03 7:53
professionalChris Losinger15-Feb-03 7:53 
GeneralRe: Un-caught exception - how do I pin it down ? Pin
Still learning how to code16-Feb-03 8:09
Still learning how to code16-Feb-03 8:09 
GeneralRe: Un-caught exception - how do I pin it down ? Pin
Scott H. Settlemier17-Feb-03 18:10
Scott H. Settlemier17-Feb-03 18:10 
GeneralSetting the lenght of a text field in an SQL Access database... Pin
IrishSonic15-Feb-03 4:36
IrishSonic15-Feb-03 4:36 

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.