flat assembler
Message board for the users of flat assembler.
Index
> Windows > Display Part of a file in a RichEdit? |
Author |
|
mns 03 Mar 2012, 12:34
Is there a way to dispay a disired part of a file in RichEdit control.
for example , from a "===============================" part to next same like part in attached file.
|
|||||||||||
03 Mar 2012, 12:34 |
|
mns 03 Mar 2012, 15:52
here with code(attached with this),I could show whole txt file in a RichEdit controle.But now I want to show part of the txt file in Rich edit control.For that can I use same methode or Is there are way in winAPI.Please someone help
|
|||||||||||
03 Mar 2012, 15:52 |
|
mns 03 Mar 2012, 16:48
|
|||
03 Mar 2012, 16:48 |
|
mns 03 Mar 2012, 16:49
According to Iczelion's Win32 Assembly tutorial
http://win32assembly.online.fr/tut33.html WM_SETTEXT methode may not be efficient if the file is large.It recommend EM_STREAMIN message. Any way my problem is how to select desired part of the file and loading it to RichEdit.Please help?? |
|||
03 Mar 2012, 16:49 |
|
JohnFound 03 Mar 2012, 17:11
Well, WM_SETTEXT is not "a method", I hope you understand there is no object oriented programming in WinAPI.
At second, you must determine what part of the text you need - the offset of the begining and the end of the block you need. So, now you have to put one 0 byte/word at the end of the text and pass the pointer of the begining to WM_SETTEXT. Another option (if you insist on EM_STREAMIN) you can make the stream callback function to read only the part of the file you need. You can use the function SetFilePointer in order to begin the read from the middle of the text and simply to return 0 if the needed chunk was already read. |
|||
03 Mar 2012, 17:11 |
|
mns 03 Mar 2012, 17:18
thank you very much JohnFound.I'll try with SetFilePointer methode.
|
|||
03 Mar 2012, 17:18 |
|
shutdownall 03 Mar 2012, 17:38
mns wrote: According to Iczelion's Win32 Assembly tutorial What was the date of this tutorial creation and what is large and what is fast ? A modern PC can read up 1 GByte in memory with DDR3 RAM in less than one second (theoretical value). Modern SATA disks can read 150 MByte/s or more. What WIN internally does is another thing but I would try first. And I never found text files with a few hundred mega bytes which have to be read or edited. Maybe some large logfiles but there are concepts to build them daily. I would first try and not believe all what the tutorial says about large files. Whatever a large file is. |
|||
03 Mar 2012, 17:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.