questions about richedit

When using richedit,I found some questions:

1. stream in is too slow,especially when file is larger than 1M.I
guess maybe it's as richedit only read 4k bytes when it calls
streamincallback each time.Can I increase richedit's stream in size?

2. I want to record the scroll pos and caret pos for next time
open.But when scroll pos is more than 2000 lines,richedit cannot
scroll to the correct pos.I tried setscrollpos,linescroll,scrollcaret
but all failed.I also tried to scroll several times,then I found it
scrolled to the end of the text.

3. When opening a file including excel sheet,I found the rtf datas are
changed although the context displayed in richedit was not.I don't
know why.

4. the support to tables of richedit seems not well.How can I add some
table operations?

Are there some open source edit components support RTF format data
like richedit?
0
wei.niu (41)
11/15/2008 1:30:50 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
917 Views

Similar Articles

[PageSpeed] 31

See below...
On Sat, 15 Nov 2008 05:30:50 -0800 (PST), nw61 <wei.niu@gmail.com> wrote:

>When using richedit,I found some questions:
>
>1. stream in is too slow,especially when file is larger than 1M.I
>guess maybe it's as richedit only read 4k bytes when it calls
>streamincallback each time.Can I increase richedit's stream in size?
****
My experience is that RichEdit is very slow to load with 1M of data, whether streams are
used or not.  I immediately rewrote my code to use a listbox, because all I wanted was
fancy formatting, and that was on a per-line basis.  Ultimately, I think the control is
intrinsically slow.

As far as I know, the stream size is fixed by the creator of the rich edit control, and is
not subject to change.  
****
>
>2. I want to record the scroll pos and caret pos for next time
>open.But when scroll pos is more than 2000 lines,richedit cannot
>scroll to the correct pos.I tried setscrollpos,linescroll,scrollcaret
>but all failed.I also tried to scroll several times,then I found it
>scrolled to the end of the text.
****
No experience here.  
****
>
>3. When opening a file including excel sheet,I found the rtf datas are
>changed although the context displayed in richedit was not.I don't
>know why.
****
You would have to say a LOT more about what you are seeing; this description is vague and
useless for even understanding the question, let alone supplying an answer.
****
>
>4. the support to tables of richedit seems not well.How can I add some
>table operations?
****
As far as I know, you can't.  If you need tables and such, you might consider an HTML
control.
****
>
>Are there some open source edit components support RTF format data
>like richedit?
****
google for
	rtf open source	
The first hit gives you links to open-source code that supports RTF.
				joe
***
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
11/16/2008 5:59:27 PM
Thanks very much,dear Mr Newcomer.How are you?

>My experience is that RichEdit is very slow to load with 1M of data
....

####
What I'm writing is an outliner(hierarchical note manager
program).Listbox is good for creating code editors,but is not fit for
my outliner.
####

>You would have to say a LOT more about what you are seeing; this descripti=
on is vague and
>useless for even understanding the question, let alone supplying an answer=
..

####
For each opening file,I keep a copy in memory.When saving the
file,first I compare the copy with the rtf data in richedit,if they
are equal the file would not be saved.
But if the file includes an Excel spreadSheet or a PowerPoint
presentation,the comparing result is always not equal even if the file
is not changed.By outputing the different datas I found the some rtf
format datas of the file was changed after the file was streamed into
the richedit.It seemd when streaming in some datas of the file was
changed and when streaming out those datas was changed again.So the
file I saved was not the same as the one opened in richedit.
I guess the richedit may transform some rtf format datas to other
forms when streaming in and revert them to their original forms when
streaming out.By outputing the different characters,I found most of
them are numbers or normal ansi characters,such as '0','6','d','f' and
so on.
Not only datas of Excel spreadSheets and PowerPoint presentations will
be transformd,but also "=97=97"(chinese hyphen) will be changed to "--"
when streaming in though I used the unicode version of richedit.
####

>As far as I know, you can't.  If you need tables and such, you might consi=
der an HTML
>control.

####
A HTML control is good,but can it support embeding Excel spreadSheets
or a PowerPoint presentations easily like richedit? Active document?
ActiveX?I need study them.
####

>google for
>        rtf open source
>The first hit gives you links to open-source code that supports RTF.

####
Thanks again.I have download AbiWord and OpenOffice.OpenOffice seems
too big and what I need is actually an edit component like richedit.
####

You are so kind.Best wishes!
0
wei.niu (41)
11/17/2008 5:35:55 AM
>I guess the richedit may transform some rtf format datas to other forms wh=
en streaming in and >revert them to their original forms when streaming out=
..

####
sorry,I made a mistake.The tests show that richedit changed some rtf
format data when streaming in and changed them to others when
streaming out.
####

>Not only datas of Excel spreadSheets and PowerPoint presentations will be =
transformd,but also >"=97=97"(chinese hyphen) will be changed to "--" when =
streaming in though I used the unicode >version of richedit.

####
Tests show richedit transformed "=97=97"(chinese hyphen) to "--" when
streaming out.Maybe it's because I don't define the HyphenateProc
Function which determines how hyphenation is done in a Rich Edit
control.
####

Tests show when file including Excel spreadsheets or Powerpoint
presentations some rtf format data were changed each time streaming in
and each time were changed to different data.Below are the tests'
results:

format: character_index  new_character old_character

2726 6 b
2728 5 3
2729 8 e
2730 8 b

I saved the changed file and reopened it,it was changed again.As the
old_characters displayed below are not equal to new_characters
above,it seems the data were changed when streaming out.

2726 8 c
2728 6 9
2729 1 7
2730 3 9

It seems richedit doesn't do well enough when embeding Excel
spreadsheets or Powerpoint presentations.
0
wei.niu (41)
11/17/2008 10:59:30 AM
See below...
On Sun, 16 Nov 2008 21:35:55 -0800 (PST), nw61 <wei.niu@gmail.com> wrote:

>Thanks very much,dear Mr Newcomer.How are you?
>
>>My experience is that RichEdit is very slow to load with 1M of data
>...
>
>####
>What I'm writing is an outliner(hierarchical note manager
>program).Listbox is good for creating code editors,but is not fit for
>my outliner.
>####
****
Then at this point, you're stuck with using RichEdit, or locating a third-party control.

It may not really be suitable, but have you considered a tree control?

Another possible solution is to use an owner-draw listbox in a "spreadsheet style" where,
when you click on an element, an edit control is created, set to the contents, and then
allows editing.  Since I don't know what you are expecting the interface to look like,
this may be unsuitable, but at least contemplate it.
****
>
>>You would have to say a LOT more about what you are seeing; this description is vague and
>>useless for even understanding the question, let alone supplying an answer.
>
>####
>For each opening file,I keep a copy in memory.When saving the
>file,first I compare the copy with the rtf data in richedit,if they
>are equal the file would not be saved.
>But if the file includes an Excel spreadSheet or a PowerPoint
>presentation,the comparing result is always not equal even if the file
>is not changed.By outputing the different datas I found the some rtf
>format datas of the file was changed after the file was streamed into
>the richedit.It seemd when streaming in some datas of the file was
>changed and when streaming out those datas was changed again.So the
>file I saved was not the same as the one opened in richedit.
>I guess the richedit may transform some rtf format datas to other
>forms when streaming in and revert them to their original forms when
>streaming out.By outputing the different characters,I found most of
>them are numbers or normal ansi characters,such as '0','6','d','f' and
>so on.
>Not only datas of Excel spreadSheets and PowerPoint presentations will
>be transformd,but also "��"(chinese hyphen) will be changed to "--"
>when streaming in though I used the unicode version of richedit.
>####
****
You shouldn't need to do a comparison; if the user has modified the control, you know it
needs to be saved.  In addition, there's another trick: you run checksums of the data.  If
there's an embedded spreadsheet or powerpoint, you need to do a checksum or alternatively
ask if it has been modified.  Comparing raw data is not going to be productive.  You need
to work solely on the "modified" state of the controls
****
>
>>As far as I know, you can't.  If you need tables and such, you might consider an HTML
>>control.
>
>####
>A HTML control is good,but can it support embeding Excel spreadSheets
>or a PowerPoint presentations easily like richedit? Active document?
>ActiveX?I need study them.
>####
****
I've never tried it, but since this is the control that works with IE, IE will support
embedded spreadsheets and powerpoint displays, but I can't speak to the ease; likewise
ActiveX stuff.  But there are people in this newsgroup who have used it much more
extensively than I have, and might be able to answer this
****
>
>>google for
>>        rtf open source
>>The first hit gives you links to open-source code that supports RTF.
>
>####
>Thanks again.I have download AbiWord and OpenOffice.OpenOffice seems
>too big and what I need is actually an edit component like richedit.
>####
>
>You are so kind.Best wishes!
****
Good luck.
			joe
****
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
11/17/2008 4:29:48 PM
>It may not really be suitable, but have you considered a tree control?

####
Yes, I used a treeview control.
####

>Another possible solution is to use an owner-draw listbox in a "spreadsheet style" where,
>when you click on an element, an edit control is created, set to the contents, and then
>allows editing.  Since I don't know what you are expecting the interface to look like,
>this may be unsuitable, but at least contemplate it.

####
You are right.I chose the same approach as what you said,just a little
different that I didn't create an edit control each time an element
was clicked,instead I cleard the edit's content.
####

>You shouldn't need to do a comparison; if the user has modified the control, you know it
>needs to be saved.  In addition, there's another trick: you run checksums of the data.  If
>there's an embedded spreadsheet or powerpoint, you need to do a checksum or alternatively
>ask if it has been modified.  Comparing raw data is not going to be productive.  You need
>to work solely on the "modified" state of the controls

####
I ever tried EN_CHANGED notification but failed.So I had to compare
the texts.Maybe I will have a try next time.Checksum is very
good,thanks again.
####

>I've never tried it, but since this is the control that works with IE, IE will support
>embedded spreadsheets and powerpoint displays, but I can't speak to the ease; likewise
>ActiveX stuff.  But there are people in this newsgroup who have used it much more
>extensively than I have, and might be able to answer this

####
I need study more about COM and .Net.
####

>Good luck.

####
Good Luck.
####
0
wei.niu (41)
11/18/2008 6:51:23 AM
See below...
On Mon, 17 Nov 2008 22:51:23 -0800 (PST), nw61 <wei.niu@gmail.com> wrote:

>
>>It may not really be suitable, but have you considered a tree control?
>
>####
>Yes, I used a treeview control.
>####
>
>>Another possible solution is to use an owner-draw listbox in a "spreadsheet style" where,
>>when you click on an element, an edit control is created, set to the contents, and then
>>allows editing.  Since I don't know what you are expecting the interface to look like,
>>this may be unsuitable, but at least contemplate it.
>
>####
>You are right.I chose the same approach as what you said,just a little
>different that I didn't create an edit control each time an element
>was clicked,instead I cleard the edit's content.
>####
>
>>You shouldn't need to do a comparison; if the user has modified the control, you know it
>>needs to be saved.  In addition, there's another trick: you run checksums of the data.  If
>>there's an embedded spreadsheet or powerpoint, you need to do a checksum or alternatively
>>ask if it has been modified.  Comparing raw data is not going to be productive.  You need
>>to work solely on the "modified" state of the controls
>
>####
>I ever tried EN_CHANGED notification but failed.So I had to compare
>the texts.Maybe I will have a try next time.Checksum is very
>good,thanks again.
>####
****
Note that to get EN_CHANGE notifications from a rich edit, you must enable this
notification.  

If ctl is a CRichEditCtrl, then you would do

	ctl.SetEventMask(ctl.GetEventMask() | ENM_CHANGE);

This is actually explained to you by the code that EN_CHANGE handlers generate.
				joe
****
>
>>I've never tried it, but since this is the control that works with IE, IE will support
>>embedded spreadsheets and powerpoint displays, but I can't speak to the ease; likewise
>>ActiveX stuff.  But there are people in this newsgroup who have used it much more
>>extensively than I have, and might be able to answer this
>
>####
>I need study more about COM and .Net.
>####
>
>>Good luck.
>
>####
>Good Luck.
>####
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
11/18/2008 5:34:05 PM
Reply:

Similar Artilces:

Backup question
I've moved to a new pc and for some reason I thought that when you backed up, a new file was created. Am I right? At the moment, it's just backing up to the backup file. So I've just just my working file and my backup file. Please could you clarify this? Thanks again. In microsoft.public.money, abc wrote: >I've moved to a new pc and for some reason I thought that when you >backed up, a new file was created. Am I right? At the moment, it's >just backing up to the backup file. So I've just just my working file >and my backup file. P...

Question about Xml Schemas "qualified" and "unqualified"
In the textbook, there is a sentence that "Default XML namespaces(xmlns="...") helps a lot, but can also create problems, as a side effect of the rules for automatic qualification. How to understand "automatic qualification" here? Could you please give me an example? Secondly, unless otherwise specified, a schema prescribes that loal elements and attributes must be "unqualified". What does "unqualified" mean? Could you please giv eme an example? Finnaly, could you please tell me what's purpose of using these two things? Thanks a lot! ...

a question and a question
What is the correct name of the type of selection box used in "customizing Word", for example.... you select a word or operation from a list on the left pane and move it over to the right pane. Is there a template to build one of these? thanx You will have to explain more in detail what you are trying to do. -- Stefan Blom Microsoft Word MVP "cliffordjf" <cliffordjf@discussions.microsoft.com> wrote in message news:9856CCA7-8A8E-440C-A0D4-76EE4FA644E2@microsoft.com... > What is the correct name of the type of selection box used in "c...

Question about Paste Special
Hi, I have a problem sometimes with the paste special options when goin from one excel workbook to another. For example, sometimes when I cop data from one workbook and then paste special into another, I get th options that include: All, formulas, values, formats, has the option t transpose the data and paste link among other options. And the sometimes I try and paste data to another workbook and I end up th paste special options: Bitmap Image Object, picture, bitmap, and I als lose the ability to paste link. Well you can do it, but it puts it i as an object. What I want is the first past...

IE8 privacy question
I am running XP-Pro SP3 and considering upgrading from IE7 to IE8. I have read all the feature and benefit articles from MS, but have one question that remains unanswered. In IE8 there is mention of being able to restore previously viewed websites or something to that effect. I think this is on a drop down menu somewhere. 1) Does In-private viewing prevent this? 2) Does manually deleting your complete browsing history clear this? 3) Is there a registry entry that can prevent this action? 4) Is there a group policy change that can prevent this action? In essence for privacy pur...

IF AND question
Hi there, I need a function that can provide one of three answers: 1 2 1 1... 3 3 4 4... ? ? ? ?... If A1 = 1 and A2=3, answer 106; but if A1=1 and A2 = 4, answer 104; but if A1=2, regardless of A2, answer 95. The next function for column B is the same, except the answer is dependent on the value delivered from the column A function. E.g. A3 + 6 or A3 +4 or A3-5 etc. Any help would be most appreciated. -- ***** Many thanks Gamq Use the below formula for your first query. =IF(A1="","",IF(A1=2,95,IF(AND(A1=1,A2=3),106,IF(AND(A1=1,A2=4),104)))) ...

Microsoft Query question
I am trying to use Microsoft Query to get data from my SQL 2000 databases. The problem is that I have a few columns with names that conflict with keywords (like Identity). (Yes. I kow that keywords should be avoided but it is done and cannot be changed.) This is causing a keyword syntax error within the Query application. Oddly enough, even if I do not select the column the error still appears. And when you look at all the columns available, the keyword named column shows up in boldface. When I am doing queries in other programs I put square ("[ ]") brackets around column and table...

Question
Why did the chicken cross the road? -- Dr. Stephen Hopkins, MD "Dr. Stephen Hopkins, MD" <DrStephenHopkinsMD@discussions.microsoft.com> wrote in message news:B8434E21-DDA3-44D7-B39B-CD5A8C33A7BD@microsoft.com... > Why did the chicken cross the road? > -- > Dr. Stephen Hopkins, MD To collect her email, why else? Dr? You should be ashamed to put such a title on an idiotic off topic post !! -- Regards Steve. MS-MVP. MAIL. [DTS] UK. http://www.getsafeonline.org/ mac;1266180 Wrote: > "Dr. Stephen Hopkins, MD" <DrSte...

OWA Question #16
Hello All: Quick Question regarding OWA. We are about to finalize migration from 5.5 to 2003. We have an existing web presence already in DNS a www.mydomain.com. and running on existing web servers. With 5.5 natrually, to access OWA, it was www.mydomain.com/exchange. This will not be possible now since OWA runs off of the Exchange server instead of relying on our web server under 5.5. What's the easiest way to overcome this. Thanks If you can afford the extra license, you'll probably want to run a front-end server so no one is connecting directly to the Exchange database s...

Text Box Question
Greetings, I have been using Visio for years, however, something has happened and I can't figure out how to undo it. Basically up until today when I added a text box and entered text, the text went horizontal as it was typed. Today when I add a text box and enter text, the text goes vertical. How do I get back to the old behavior? TIA using text container shape adjusting tool (text block tool), make the text container shape wider horizontally. Have you used Asian text font recently?...check help for "vertical text" "Ray Batig" wrote: > Greetings, > &g...

401K questions
I just started a 401K at work and I'm wondering how to deal with it in Money. I've got my paycheck split into different categories currently and now I have to put the 401K amount into a category as well. I didn't see one specifically for this. What do other people use? Should I start using the 401K Manager? I haven't gone through it yet I'm just wondering if it works well and how much benefit I'll get from it. Thanks in advance! Mike You will want to create an investment account for the 401(k) and TRANSFER your contributions from your checking account to the...

VBA//Oracle Interfacing Question
All, I have been able to correct to my database but I have one question question: Within objSession I want to list all available tables and all available views. How exactly is this done? thank you. Set objSession = CreateObject("OracleInProcServer.XOraSession") Set objDatabase = objSession.OpenDatabase("", "User/Pass", 0) On Nov 16, 12:05=A0pm, jason <jason.mell...@gmail.com> wrote: > All, > > I have been able to correct to my database but I have one question > question: > > Within objSession I want to list all avail...

If / Then Question
How would I do this: IF A1="N" then I need A2 and A3 to="N/A -- pkniven ----------------------------------------------------------------------- pknivens's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2767 View this thread: http://www.excelforum.com/showthread.php?threadid=47531 pknivens Wrote: > How would I do this: > > IF A1="N" then I need A2 and A3 to="N/A" Hi pknivens In A2 and A3 use this formula > =IF(A1="N","N/A",""), this will return blank if A1 is not N, if you want it...

ROWCOUNT question
Hi All, The below is a UDF that returns the ROWCOUNT for a table. I need to know that value for WHILE loop. How do I take the Returned value from the UDF and load it intio a variable in the SP where it was called from? Or maybe there is another way. ALTER FUNCTION [dbo].[RecCount] ( @TableName CHAR(15) ) RETURNS TABLE AS RETURN ( SELECT Rows FROM sysindexes WHERE id = OBJECT_ID(@TableName) AND indid < 2 ) Thanks, Eric Eric S (xxx_noSpam@Hotmail.com) writes: > The below is a UDF that returns the ROWCOUNT for a table. I need to know > that va...

Exmerge Question #7
When I run Exmerge on a mailbox on my 2003 server to export to a PST, it will delete all emails after the copy. I thought EXmerge would "copy" not delete. is this the default? If so how can I just have it do a copy out to the PST and leave the mailbox alone. thanks Rick in "options", make sure "archive data to target store" is not selected on the "Import procedure" tab... -- Susan Conkey [MVP] "Rick" <drummer10980@gmail.com> wrote in message news:1165509540.777142.38260@16g2000cwy.googlegroups.com... > When I run Exmerge on ...

question about "delete"
I have a pointer: MyWindowClass *p = NULL; p = new MyClass(...); .... delete p; After delete p, does p equal NULL(it is in C++ standard?)? How to decide if p has been deleted? The reason I asked this question is that in my project, there are many code/files use the pointer which I need to determine is it is deleted? Can I use: if(p != NULL) delete p; I guess somewhere p has been deleted, but p still not NULL(possible?), the above code might cause problem. Hi Kathy, I typically just set p to NULL when I delete it: delete p; p = NULL; Then you can check it in other places and ...

More combining companies questions
We too have acquired another company and need to look at all of our options concerning what to do with email. We run Exchange 2003, they run Exchange 2000. What is the best way to combine the two so we can share GAL, free-busy info, etc.? No decisions have been made as far as what we are going to do with their AD. We could of course change their MX record to point to our server, update our RUS, etc., but what if we want to keep an Exchange server at their site? What has to be done to join their server to our Exchange org? If you want sync both GAL,pls check this http://www.microso...

switchboard question 12-26-07
Is there a way to put the names of different switchboard pages on the switchboard form? If you put one name on a switchboard page (in form design view), the same name appears on all the switchboard pages. I understand why this happens, but what if I want the user to be able to know which switchboard s/he is on? Thanks. PS the same thing happens if I go into form design view and put in control tip text. It puts the same text for the same-numbered menu item on two different switchboard pages. "Debbie S." wrote: > Is there a way to put the names of different switchboard ...

Some Questions about Outlook
1. what's the max size of attachment for sending email? 2. newMail notifitor: when there is a new mail, can the tary be changed to other until i check the mail? can it work with hotmail? 3. is there any function likes "To Do List"; calendar require time setting? 4. configure file backup; can i back up all of my setting? -- Me, Who I am On Sun, 7 May 2006 22:17:01 -0700, Dotku <lwjct@hotmail.com> wrote: >1. what's the max size of attachment for sending email? That would depend on your mail server/ISP. >2. newMail notifitor: when there is a new mail, can the ...

Simple CRM 3.0 Questions
- If an account is no longer active, what's the process to make it inactive? - Can a lead have multiple contacts, with one acting as the primary contact? - When I create a new lead, what the 'Topic' field usually used for? - When creating a lead, on the Details Page, how can I add entries into the 'Industry' and 'Lead Source' drop down lists? - Will CRM track all e-mails associated with a lead? How do I ensure this? - How do I promote a Lead to an Opportunity to an Account? - What's the real definition of an Opportunity? It seems so grey compared to...

Toolbar question
I have created a combo box on my toolbar. I am using 32 x 32 buttons, so my combo box is sitting high up. I would like to move it down to the center of the toolbar. To create it I used the following code, CRect rect; SetButtonInfo(14, IDC_FILTERNAMECB, TBBS_SEPARATOR, 200); GetItemRect(14, &rect); rect.bottom = rect.top + 200; m_cbFilterNames.Create(WS_TABSTOP | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT, rect, this, IDC_FILTERNAMECB); How do I tell it to place itself in the center of the toolbar? Here is my code: code is from inherited CToolba...

number format question
I need excel to format a list of ip addresses. The problem I am having is that I cannot figure out how to get the columns formatted so any number I put in will be three digits. So a two digit number such as "24" needs to become a three digit number (024 in this example). Here is a real example, if I enter: 158.2.151.13 Excel needs to make it: 158.002.151.013 Can this be done? Thanks all! ...

Question to Microsoft
Hi, I am really fedup with this news group if no one reply what is the use of this site. I have a suggestion why dont you show reply send with the question. Thanks ...

Newbie question about Ex 2003
Hi to the Gurus amongst you, sorry about the length of this but I feel the need to fill you in with the scenario before I ask the questions. I have just got a new job with a global company. I used to work at a school before with two domains and about 800 users. I have installed and maintained Exchange 2002 at the school. The new company wants to get better organised with their e-mail. They are not running any form of Exchange, they have Linux servers with their own portal and a couple or three W2k servers (Don't know yet which service packs are installed). They are using Outlook...

Headquarters question.
I have a 7 store + 1 warehouse in which purchase orders do not get created for each individual store. What takes place is that the purchasing manager purchases for the warehouse then distributes inventory to the individual stores. Any ideas? Hi Phil, I am assuiming that you have already purchase RMS HQ and RMS Store. In this setup , you will need 1 HQ and 8 Store..1 store license that will function as a Warehouse only and 7 for Stores that will do the sales and inventory transfer except for PO. In this way, you can have a centralized purchasing location ----------------------------...