Page 1 of 1

PostPosted: Oct 24, 2006 @ 9:02am
by Ryumaster
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.

PostPosted: Oct 24, 2006 @ 2:21pm
by Matias

PostPosted: Oct 24, 2006 @ 9:12pm
by Ryumaster
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 :)

PostPosted: Oct 30, 2006 @ 4:31pm
by Sergio
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.

PostPosted: Oct 30, 2006 @ 7:36pm
by Ryumaster
Great! You are really doing a very great job, I'm happy that I'm using GledPlay :)