Re: Convert TCHAR to integer!
Yes inded, that's what it was!
Thanks for your feedback David!
You have yourself a nice day!
:-)
--
Best regards
Robert
"David Wilkinson" wrote:
Robby wrote:
Hello,
As I now know that const or not, either way the parameter is accepted in the
_ttoi() function.
On that note...
Please consider the following code:
===================================================
case WM_COMMAND:
if ((LOWORD(wParam) >= extnl_INT_INPUT_MVars[0].CW2_CV_ID) &&
(LOWORD(wParam) <= extnl_INT_INPUT_MVars[3].CW2_CV_ID) )
//Fetch function!
UpDateSimExtrnlInputs_INT(wParam, lParam, &io,
HWND_CW2_extnl_INT_INPUT_CV);
...other code ....
==================================================
===============================UpDateSimExtrnlInputs_INT()
void UpDateSimExtrnlInputs_INT(WPARAM wParam, LPARAM lParam, IO *io,
HWND HWND_CW2_extnl_INT_INPUT_CV[])
{
int k;
//TCHAR szBufferINPUT[] = _T("12345"); Tried it ! Gives error!
TCHAR szBufferINPUT[10]; //Declare 10 character array
SendMessage(
(HWND) lParam, WM_GETTEXT,
5, (LPARAM)szBufferINPUT ); //Get the text in the control
//The next line should convert the string buffer to an integer
k = _ttoi(szBufferINPUT); //This line gives the error!
}
=====================================================
Here is the error that I get:
c:\_DTS_PROGRAMMING\C_PROGRAMMING\vc++\MY_APPS_LAB\XPPLC\WndProc_CW2.cpp(780):
error C3861: '_ttoi': identifier not found, even with argument-dependent
lookup
I have re-posted this question, and the fellows that answered the previous
post are very welcome to continue with it and I will more that willingly work
on all your feedback. I find the previous post had too many topics and I was
getting confused that's all! :)
I don't disagree with you Brian, hence, yes, gosh, Yes we are in trouble!
I know that the TEXT macro is defined in a few ways like as:
#define _T(x) __T(x)
and so that's where David got the following line:
TCHAR szBufferINPUT[] = _T("12345");
But I get an error on this...!
c:\_DTS_PROGRAMMING\C_PROGRAMMING\vc++\MY_APPS_LAB\XPPLC\WndProc_CW2.cpp(768): error C3861: '_T': identifier not found, even with argument-dependent lookup
But you see that SendMessage() will get different text from different
controls. So:
TCHAR szBufferINPUT[] = _T("12345");
can't be so. The buffer has to be filled in with a new values everytime. And
I did try it if you look at the above code!
Anyways I still would appreciate some help on this topic!
Thankyou news groups!
Robby:
Clearly, you are missing an include. <tchar.h> perhaps?
David Wilkinson