atof() and _tstof() in VC6.0

P

Pete C.

JoeKowalski said:
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/default.asp?url=/library/en-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::eek:stringstream

- Pete
 
J

Johan Rosengren

Joe,

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

Johan Rosengren
Abstrakt Mekanik AB
 
J

JoeKowalski

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/default.asp?url=/library/en-us/vclib/html/
_crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

Regards,
Joe.
 
J

JoeKowalski

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/default.asp?url=/library/en-us/vclib/html/
_crt_atof.2c_.atoi.2c_._atoi64.2c_.atol.asp

Regards,
Joe.
 
P

Pete C.

(rearranged)
Because it reverses the order in which people naturally read.
Why?
Please don't top-post.


Johan said:
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
 
J

Johan Rosengren

Pete,

Pete C. said:
(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?
:)
<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
 
J

JoeKowalski

Pete C. said:
(rearranged)
Because it reverses the order in which people naturally read.
Why?
Please don't top-post.



<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.
 
P

Pete C.

Johan said:
Pete,



First of all. who died and made you king - I post in any order I
like, OK?
http://www.parashift.com/c++-faq-lite/how-to-post.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? :)


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
 
I

Ian Semmel

What I hate is people who delete all the original message body in a reply.

I also don't like bottom-posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top