|
-
Jan 21st, 2019, 10:54 AM
#1
Re: RTF-control performance problem
 Originally Posted by Mith
there is also a performance problem using the function .LoadFile:
1. loading a text file with 8,41 MB using .LoadFile with the parameter RtfLoadSaveFormatText takes only 1 second
2. loading a text file with 8,41 MB using .LoadFile with the parameter RtfLoadSaveFormatUnicodeText takes ~100 seconds!
i found the function "LoadFile(ByVal FileName As String, Optional ByVal Format As RtfLoadSaveFormatConstants = RtfLoadSaveFormatRTF, Optional ByVal SelectionOnly As Boolean)" at the source code and included a do-loop to read chunks from the file but i dont know how to use the func "StreamStringIn" multiple times. everytime i call StreamStringIn the previous added text will be deleted. any hints how to do that?
I can't replicate the issue.
I tested this with a text file which was ANSI and was 5,68 MB file big. I just re-saved them as Unicode and it went to 11,3 MB.
Both file loadings take same time. ~0,87 sec
So I can't see why it would take 100 sec!
Please provide a demo. Thanks
EDIT:
Update released. I found the issue. The issue was that you loaded an actual ANSI file (no Unicode BOM) with the RtfLoadSaveFormatUnicodeText flag.
However, now when RtfLoadSaveFormatUnicodeText is used it will remove the SF_UNICODE flag in case there is no Unicode BOM = Solved.
This means RtfLoadSaveFormatUnicodeText will be same as RtfLoadSaveFormatText in case you load a non-Unicode file (e.g. ANSI)
I think this solution is properly and therefore RtfLoadSaveFormatUnicodeText is save to use in any case now.
Last edited by Krool; Jan 21st, 2019 at 11:33 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|