Saeed Vaezi
asked on
working with numbers in editbox in mfc c++ application
Hello dear experts
I have a editbox in mfc dialog based application.
user must enter a long number in editbox (like 123456789123456789) and the application must make some calculations on it and then show it to user on another editbox.
how can I convert CString to long int and after calculation again convert long int to CStirng to pass to next editbox.
thank you
I have a editbox in mfc dialog based application.
user must enter a long number in editbox (like 123456789123456789) and the application must make some calculations on it and then show it to user on another editbox.
how can I convert CString to long int and after calculation again convert long int to CStirng to pass to next editbox.
thank you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It was very easy
for converting CString to long long int just use _wtoll() function
and for converting long long int to CString again just define a temporary CString like:
CString tempstr;
tempstr.format(L"%lld",you r long long int);
for converting CString to long long int just use _wtoll() function
and for converting long long int to CString again just define a temporary CString like:
CString tempstr;
tempstr.format(L"%lld",you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if i would have been asked to close the question, I would have recommended an equal split between #a42473406 (assist) and #a42473791 (accept).
but the comment of the Questioner showed that neither solution actually was looked on, let alone tested. by providing an own solution (which is inferior to the given solutions) we have the case that a simple thread which had two suitable answers now had become complex and rarely useful for the knowledgebase.
so, my recommendation is to delete the question.
Sara
but the comment of the Questioner showed that neither solution actually was looked on, let alone tested. by providing an own solution (which is inferior to the given solutions) we have the case that a simple thread which had two suitable answers now had become complex and rarely useful for the knowledgebase.
so, my recommendation is to delete the question.
Sara
ASKER
I'm new in c++ and mfc. thanks for your answer but I tested your answer on New project in visual studio 2017 mfc project and it not working (I don't know why can you help me why?). But my problem resolved with comment I posted. _wtoll() is exactly spelled like this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There are two valid solutions and the Autor gave feedback. I recommend to close the question with an equal split although we didn't get a final response that the solutions have worked.
Sara
Sara
Open in new window