This site is no longer active and is available for archival purposes only. Registration and login is disabled.

How to read TCHAR text from files


Postby Ryumaster » Oct 24, 2006 @ 9:02am

Hi! It is not really a bug, but can you please tell me, what type of variable should I use with textFile.read(&buffer, 1000) for &buffer. When type is BYTE, by default, it reads well from non-unicode text documents, but I can not figure out, how to output loaded text with pBackBuffer->drawFormattedText, because it requers TCHAR type as 5th parametr. And if I set &buffer variable as TCHAR type, or any other (not BYTE), it is not working with unicode, and none-unicode text documents, I mean it reads just some single characters like '[]' in to the &buffer variable and thats is all. Maybe there is some way to convert from byte to tchar? I have read many manuals for this 4 days and just can't figure it out.
User avatar
Ryumaster
pm Member
 
Posts: 86
Joined: Sep 17, 2006 @ 11:24am
Location: Lithuania, Kaunas


Postby Matias » Oct 24, 2006 @ 2:21pm

Matias Saguir - GledPlay Lead Developer
User avatar
Matias
pm Member
 
Posts: 20
Joined: Oct 11, 2006 @ 9:57pm


Postby Ryumaster » Oct 24, 2006 @ 9:12pm

Hi! It is not ugly workaround and works perfect for me =) Afcourse, I don't really know how fast will it work for huge text files (500kb or more), but for now it is ok for futher testings - thanks for answering very fast. At last now I know how to convert between different types :)
User avatar
Ryumaster
pm Member
 
Posts: 86
Joined: Sep 17, 2006 @ 11:24am
Location: Lithuania, Kaunas


Postby Sergio » Oct 30, 2006 @ 4:31pm

Hi Ryumaster,
I'm happy to tell you that the new GledPlay release (build 195) implements a nicer solution for this problem.

Now, the File class has a readLine method, which loads text from a plain ascii file, to a TCHAR* string.



Regards,
Sergio.
Sergio Fierens

User avatar
Sergio
pm Member
 
Posts: 97
Joined: Mar 17, 2006 @ 2:43pm


Postby Ryumaster » Oct 30, 2006 @ 7:36pm

Great! You are really doing a very great job, I'm happy that I'm using GledPlay :)
I love postindustrial life.
User avatar
Ryumaster
pm Member
 
Posts: 86
Joined: Sep 17, 2006 @ 11:24am
Location: Lithuania, Kaunas


Return to GledPlay


Sort


Forum Description

Game Engine for Embedded Devices. Simple, complete, and powerful. Focused on the game.

Moderators:

Matias, Sergio

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron