473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

atof() and _tstof() in VC6.0

Hello,

i'm converting a big MFC application to support UNICODE so it can be
translated into chinese/japanese.
The application is made with visual studio 6.0 and i want to be able to
compile it with and without the _UNICODE preprocessor definition.

For this i'm using the functions provided by TCHAR.H, e.g. i'm changing all
atoi(..) commands in _wtoi(..) commands so it will suport both _UNICODE and
single byte characters.

The problem i'm having is with atof(..), TCHAR.H doesn't provide a function
for it (yet) in Visual Studio 6.0 which supports both UNICODE and
non-UNICODE. In Visual Studio 7.x the function _tstof(..) does this which
is also
defined in the

Do i need to upgrade to Visual Studio 7.x or can i download some package
which upgrades the TCHAR libraries?

The commands i would like to use can be found in this MSDN section and all
start with _tst or _tt:

http://msdn.microsoft.com/library/de...us/vclib/html/
_crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

Regards,
Joe.
Jul 22 '05 #1
9 7299
Sorry, made some errors in my post, here is the message again:

Hello,

i'm converting a big MFC application to support UNICODE so it can be
translated into chinese/japanese.
The application is made with visual studio 6.0 and i want to be able to
compile it with and without the _UNICODE preprocessor definition.

For this i'm using the functions provided by TCHAR.H, e.g. i'm changing all
atoi(..) commands in _ttoi(..) commands so it will suport both _UNICODE and
single byte characters. With _UNICODE defined this will result in a
_wtoi()command, without _UNICODE defined this will result in a atoi()
command.

The problem i'm having is with atof(..), TCHAR.H doesn't provide a function
for it (yet) in Visual Studio 6.0 which supports both UNICODE and
non-UNICODE. In Visual Studio 7.x the function _tstof(..) does this which
is also
defined in the TCHAR.H file.

Do i need to upgrade to Visual Studio 7.x or can i download some package
which upgrades the TCHAR libraries?

The commands i would like to use can be found in this MSDN section and all
start with _tst or _tt:

http://msdn.microsoft.com/library/de...us/vclib/html/
_crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

Regards,
Joe.
"JoeKowalski" <Jo*********@usa.com> wrote in message
news:40***********************@news.xs4all.nl...
Hello,

i'm converting a big MFC application to support UNICODE so it can be
translated into chinese/japanese.
The application is made with visual studio 6.0 and i want to be able to
compile it with and without the _UNICODE preprocessor definition.

For this i'm using the functions provided by TCHAR.H, e.g. i'm changing all atoi(..) commands in _wtoi(..) commands so it will suport both _UNICODE and single byte characters.

The problem i'm having is with atof(..), TCHAR.H doesn't provide a function for it (yet) in Visual Studio 6.0 which supports both UNICODE and
non-UNICODE. In Visual Studio 7.x the function _tstof(..) does this which
is also
defined in the

Do i need to upgrade to Visual Studio 7.x or can i download some package
which upgrades the TCHAR libraries?

The commands i would like to use can be found in this MSDN section and all
start with _tst or _tt:

http://msdn.microsoft.com/library/de...us/vclib/html/ _crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

Regards,
Joe.

Jul 22 '05 #2
JoeKowalski wrote:
Sorry, made some errors in my post, here is the message again:

Hello,

i'm converting a big MFC application to support UNICODE so it can be
translated into chinese/japanese.
The application is made with visual studio 6.0 and i want to be able
to compile it with and without the _UNICODE preprocessor definition.

For this i'm using the functions provided by TCHAR.H, e.g. i'm
changing all atoi(..) commands in _ttoi(..) commands so it will
suport both _UNICODE and single byte characters. With _UNICODE
defined this will result in a _wtoi()command, without _UNICODE
defined this will result in a atoi() command.

The problem i'm having is with atof(..), TCHAR.H doesn't provide a
function for it (yet) in Visual Studio 6.0 which supports both
UNICODE and non-UNICODE. In Visual Studio 7.x the function
_tstof(..) does this which is also
defined in the TCHAR.H file.

Do i need to upgrade to Visual Studio 7.x or can i download some
package which upgrades the TCHAR libraries?

The commands i would like to use can be found in this MSDN section
and all start with _tst or _tt:

http://msdn.microsoft.com/library/de...us/vclib/html/ _crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

<snip>

Your question has nothing to do with C++; therefore it is off-topic here.
Please re-ask in microsoft.vc.public.language.
Hint: std::istringstream and std::ostringstream

- Pete
Jul 22 '05 #3
Joe,

If nothing else, perhaps you could try using _tcstod instead?

Johan Rosengren
Abstrakt Mekanik AB

"JoeKowalski" <Jo*********@usa.com> skrev i meddelandet
news:40*********************@news.xs4all.nl...
Sorry, made some errors in my post, here is the message again:

Hello,

i'm converting a big MFC application to support UNICODE so it can be
translated into chinese/japanese.
The application is made with visual studio 6.0 and i want to be able to
compile it with and without the _UNICODE preprocessor definition.

For this i'm using the functions provided by TCHAR.H, e.g. i'm changing all atoi(..) commands in _ttoi(..) commands so it will suport both _UNICODE and single byte characters. With _UNICODE defined this will result in a
_wtoi()command, without _UNICODE defined this will result in a atoi()
command.

The problem i'm having is with atof(..), TCHAR.H doesn't provide a function for it (yet) in Visual Studio 6.0 which supports both UNICODE and
non-UNICODE. In Visual Studio 7.x the function _tstof(..) does this which
is also
defined in the TCHAR.H file.

Do i need to upgrade to Visual Studio 7.x or can i download some package
which upgrades the TCHAR libraries?

The commands i would like to use can be found in this MSDN section and all
start with _tst or _tt:

http://msdn.microsoft.com/library/de...us/vclib/html/ _crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

Regards,
Joe.
"JoeKowalski" <Jo*********@usa.com> wrote in message
news:40***********************@news.xs4all.nl...
Hello,

i'm converting a big MFC application to support UNICODE so it can be
translated into chinese/japanese.
The application is made with visual studio 6.0 and i want to be able to
compile it with and without the _UNICODE preprocessor definition.

For this i'm using the functions provided by TCHAR.H, e.g. i'm changing

all
atoi(..) commands in _wtoi(..) commands so it will suport both _UNICODE

and
single byte characters.

The problem i'm having is with atof(..), TCHAR.H doesn't provide a

function
for it (yet) in Visual Studio 6.0 which supports both UNICODE and
non-UNICODE. In Visual Studio 7.x the function _tstof(..) does this which is also
defined in the

Do i need to upgrade to Visual Studio 7.x or can i download some package
which upgrades the TCHAR libraries?

The commands i would like to use can be found in this MSDN section and all start with _tst or _tt:

http://msdn.microsoft.com/library/de...us/vclib/html/
_crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

Regards,
Joe.


Jul 22 '05 #4
(rearranged)
Because it reverses the order in which people naturally read.
Why?
Please don't top-post.
Johan Rosengren wrote:
Joe,

If nothing else, perhaps you could try using _tcstod instead?

Johan Rosengren
Abstrakt Mekanik AB

<snip>

Hmm, even when I include all of the C++ and C headers, my compiler reports
that that function doesn't exist. How odd, because something non-standard
surely wouldn't be posted here...

- Pete
Jul 22 '05 #5

"Pete C." <x@x.x> wrote in message
news:gi******************@newsread2.news.pas.earth link.net...
(rearranged)
Because it reverses the order in which people naturally read.
Why?
Please don't top-post.
Johan Rosengren wrote:
Joe,

If nothing else, perhaps you could try using _tcstod instead?

Johan Rosengren
Abstrakt Mekanik AB

<snip>

Hmm, even when I include all of the C++ and C headers, my compiler reports
that that function doesn't exist. How odd, because something non-standard
surely wouldn't be posted here...

- Pete


Sorry, that's my mistake..

I cross-posted the original message in microsoft.public.vc.mfc and in
comp.lang.c++. I forgot MFC questions should not be posted here. That's why
some are replying in this c++ newsgroup, just like you are replying that
this is 'Off-topic' in the microsoft MFC newsgroup.

Joe.
Jul 22 '05 #6
Pete,

"Pete C." <x@x.x> skrev i meddelandet
news:gi******************@newsread2.news.pas.earth link.net...
(rearranged)
Because it reverses the order in which people naturally read.
Why?
Please don't top-post.

First of all. who died and made you king - I post in any order I like, OK?

A few notes:

1. For short questions with a short answer, I normally top-post, and prefer
if other do it as well as it is easy to - at a glance - see if there is more
to add to the answer. I do not, however, try to impose my opinions in this
question on others, and would be happy if you refrained from the same.

2. When a post merits comments, I put them in the "normal" sequence.

And finally, do you repeat all of a conversation for every new utterance?
:-)

Johan Rosengren wrote:
Joe,

If nothing else, perhaps you could try using _tcstod instead?

Johan Rosengren
Abstrakt Mekanik AB
<snip>

Hmm, even when I include all of the C++ and C headers, my compiler reports
that that function doesn't exist. How odd, because something non-standard
surely wouldn't be posted here...

- Pete


Oh, *sorry*, I thought the "VC6.0" in the title of the post and the
cross-post would be a dead give-away!

People like you really give a new and interesting meaning to concepts such
as "friendliness", "community spirit" and "helpfulness". Such as
"arrogance", "pompous" and "twit".

Johan Rosengren
Abstrakt Mekanik AB

Jul 22 '05 #7
Johan Rosengren wrote:
Pete,

"Pete C." <x@x.x> skrev i meddelandet
news:gi******************@newsread2.news.pas.earth link.net...
(rearranged)
Because it reverses the order in which people naturally read.
Why?
Please don't top-post.

First of all. who died and made you king - I post in any order I
like, OK?


http://www.parashift.com/c++-faq-lit...t.html#faq-5.4

A few notes:

1. For short questions with a short answer, I normally top-post, and
prefer if other do it as well as it is easy to - at a glance - see if
there is more to add to the answer. I do not, however, try to impose
my opinions in this question on others, and would be happy if you
refrained from the same.

2. When a post merits comments, I put them in the "normal" sequence.

And finally, do you repeat all of a conversation for every new
utterance? :-)

Johan Rosengren wrote:
Joe,

If nothing else, perhaps you could try using _tcstod instead?

Johan Rosengren
Abstrakt Mekanik AB
<snip>

Hmm, even when I include all of the C++ and C headers, my compiler
reports that that function doesn't exist. How odd, because something
non-standard surely wouldn't be posted here...

- Pete


Oh, *sorry*, I thought the "VC6.0" in the title of the post and the
cross-post would be a dead give-away!


Perhaps you could have sent your reply to only the newsgroup where it was
on-topic.

People like you really give a new and interesting meaning to concepts
such as "friendliness", "community spirit" and "helpfulness". Such as
"arrogance", "pompous" and "twit".
Yep, people like you sure do.

- Pete

Johan Rosengren
Abstrakt Mekanik AB


Jul 22 '05 #8
Pete,

"Pete C." <x@x.x> skrev i meddelandet
news:hB******************@newsread1.news.pas.earth link.net...
Johan Rosengren wrote: <snip>
First of all. who died and made you king - I post in any order I
like, OK?


http://www.parashift.com/c++-faq-lit...t.html#faq-5.4


No, I'm sorry. Didn't say you're the king of NTTP.
<snip>
Oh, *sorry*, I thought the "VC6.0" in the title of the post and the
cross-post would be a dead give-away!


Perhaps you could have sent your reply to only the newsgroup where it was
on-topic.


As opposed to your snotty reply to the OP? How many non-charter posts has
this resulted in? 5? Bravo! *clap, clap, clap*

Johan Rosengren
Abstrakt Mekanik AB
Jul 22 '05 #9
What I hate is people who delete all the original message body in a reply.

I also don't like bottom-posting.

Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Drew | last post by:
Hi: I'm having trouble getting atof() to accurately convert "3.1" Any ideas? Thank you,
4
by: Sharon | last post by:
hi all what are the reverse functions of atof( ), atoi( ) and atol( ) ? I want to change sth to string thx!
6
by: Sreekanth | last post by:
Hello, Am trying to convert a string to float. Am using atof() for that purpose. But the return value for atof is same for the string "0.0" and for some invalid input "Invalid". Can any body...
15
by: XZ | last post by:
Hi everyone, this is really confusing to me: #include <stdio.h> main(int argc, char **argv) { printf("argv = %f\n",(double)atof(argv)); printf("argv = %d\n\n",atoi(argv)); } $ a.out a argv...
21
by: oksuresh | last post by:
Hi talents, I have noticed that atof() function approximates the string I pass to it. when I use atof() , as atof(" 184.64") and it returns 184.63999999999 But I would like to have...
5
by: tjay | last post by:
Hi. I wrote some code using sprintf and atof to store a double as a string of fixed length and to convert it back to a double variable. The string is stored in a char buffer global variable. I'm...
14
by: sharmaharish | last post by:
I need a conversion function that converts values from string to a particular type. For this I have a template function that looks like this ... template<class T> T value(const string& s) {...
5
by: lcw1964 | last post by:
Greetings again, I will burden the group with yet another tenderfoot question, but since conscientious googling hasn't yield a lucid answer I thought I would risk the shortcut of asking here...
2
by: allexander | last post by:
Hello ! I need to convert a string like string number = "1235646.5678" to any floating point number x (double x or float x) I have used earlier the function atof()
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.