ERROR '_atoi64' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *'
-
This is my code segment. CString timestamp; int year = _atoi64((LPCTSTR)timestamp.Left(4)); I am getting an error like '_atoi64' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *' How can I remove it? Thanks.
-
This is my code segment. CString timestamp; int year = _atoi64((LPCTSTR)timestamp.Left(4)); I am getting an error like '_atoi64' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *' How can I remove it? Thanks.
try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
Thanks Anshuman, It worked for me.
-
try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
BTW, the
static_cast<lpctstr>()
is useless and can be omitted[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
try _ttoi(static_cast(timestamp.Left(4))); You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
_AnsHUMAN_ wrote:
try _ttoi(static_cast(timestamp.Left(4)));
Just adding to toxcct's reply,
CString
has theLPCTSTR
operator!It is a crappy thing, but it's life -^ Carlo Pallini