CRichEditCtrl with links

Hiya,

I'm using VC++ 6.0 and trying to get a CRichEditCtrl (Rich Edit 2.0)
to handle links, which is a bit tricky...

I've figured out how to set CFE_LINK and get EN_LINK notifications. So
far all is good and well.

However

1) When I save the contents (StreamOut) the attribute isn't saved,
thus if I StreamIn it back, the link's gone. Is there a way to make
the link persistent?

2) I am using arbitrary links (ie not EM_AUTOURLDETECT) and would like
to find a way to associate the link with a destination. Any ideas how
to accomplish that? I've tried making hidden text, but it doesn't
work.

I've seen .net solutions out there but they all seem based on Rich
Edit 3.0 which isn't applicable.

Thank you

/Per
0
perfnurt (11)
4/18/2005 6:58:05 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
1001 Views

Similar Articles

[PageSpeed] 8

You need to use VC++ 7.1 and call AfxInitRichEdit2( );
in order to use Rich Edit 2.0
Vaclav

"Per Nilsson" <perfnurt@hotmail.com> wrote in message
news:51412d89.0504172258.10f7649c@posting.google.com...
> Hiya,
>
> I'm using VC++ 6.0 and trying to get a CRichEditCtrl (Rich Edit 2.0)
> to handle links, which is a bit tricky...
>
> I've figured out how to set CFE_LINK and get EN_LINK notifications. So
> far all is good and well.
>
> However
>
> 1) When I save the contents (StreamOut) the attribute isn't saved,
> thus if I StreamIn it back, the link's gone. Is there a way to make
> the link persistent?
>
> 2) I am using arbitrary links (ie not EM_AUTOURLDETECT) and would like
> to find a way to associate the link with a destination. Any ideas how
> to accomplish that? I've tried making hidden text, but it doesn't
> work.
>
> I've seen .net solutions out there but they all seem based on Rich
> Edit 3.0 which isn't applicable.
>
> Thank you
>
> /Per


0
no1498 (362)
4/18/2005 12:03:18 PM
Ok, then I erroneously assumed 2.0...

Anyway, the questions remain, is there some trick (I realize there's
no such functionality in the ctrl itself) to make links persistent?

Ive tried making the "link destination" hidden inspired by the
http://www.codeproject.com/cs/miscctrl/RichTextBoxLinks.asp article),

I can set the links in my control programatically, but I'd like to
automate it further so the ctrl (derived from CRichEditCtrl) can
resolve the links automagically given some text (and I thought RTF
format would be ideal, but I guess it's not).

I guess I could invent my own text format and have the ctrl parse and
act upon it (make links etc) though, hmmm...seems silly, but getting
VC7.1 isnt an option for me yet.

CFE_LINK isn't streamed out, but Ive noticed that CFE_PROTECTED is (to
some extent) and I thought I'd use some hack to translate protection
flag to link flag when streaming. Doesn't work all that well either
though.

All I want is to have editable text that can contain links. Thats all.
Char formatting etc isn't really an issue.

Working with the rich edit ctrl is really frustrating, any ideas on
other techniques is highly appreciated.


Thanks
/Per

"Vaclav Jedlicka" <no@spam.please> wrote in message news:<ete6i6ARFHA.3868@TK2MSFTNGP10.phx.gbl>...
> You need to use VC++ 7.1 and call AfxInitRichEdit2( );
> in order to use Rich Edit 2.0
> Vaclav
0
perfnurt (11)
4/18/2005 5:18:20 PM
how about html?

"Per Nilsson" <perfnurt@hotmail.com> wrote in message
news:51412d89.0504180918.3919f65b@posting.google.com...
> Ok, then I erroneously assumed 2.0...
>
> Anyway, the questions remain, is there some trick (I realize there's
> no such functionality in the ctrl itself) to make links persistent?
>
> Ive tried making the "link destination" hidden inspired by the
> http://www.codeproject.com/cs/miscctrl/RichTextBoxLinks.asp article),
>
> I can set the links in my control programatically, but I'd like to
> automate it further so the ctrl (derived from CRichEditCtrl) can
> resolve the links automagically given some text (and I thought RTF
> format would be ideal, but I guess it's not).
>
> I guess I could invent my own text format and have the ctrl parse and
> act upon it (make links etc) though, hmmm...seems silly, but getting
> VC7.1 isnt an option for me yet.
>
> CFE_LINK isn't streamed out, but Ive noticed that CFE_PROTECTED is (to
> some extent) and I thought I'd use some hack to translate protection
> flag to link flag when streaming. Doesn't work all that well either
> though.
>
> All I want is to have editable text that can contain links. Thats all.
> Char formatting etc isn't really an issue.
>
> Working with the rich edit ctrl is really frustrating, any ideas on
> other techniques is highly appreciated.
>
>
> Thanks
> /Per
>
> "Vaclav Jedlicka" <no@spam.please> wrote in message
news:<ete6i6ARFHA.3868@TK2MSFTNGP10.phx.gbl>...
> > You need to use VC++ 7.1 and call AfxInitRichEdit2( );
> > in order to use Rich Edit 2.0
> > Vaclav


0
no1498 (362)
4/19/2005 12:13:10 PM
Hmmm, I guess I was a bit vague, sorry. By "editable text" I mean a
text editor where some parts of the text in the editor may be links
(not regular URLs, but links my app will interpret when clicked).

User interaction-wise what I'm after is pretty much like
RichEditCtrl's behavior on URLs when EM_AUTOURLDETECT is set. With the
significant exceptions that
1) The destination != the link description
2) Its not related to URLs.


Thanks
/Per


"Vaclav Jedlicka" <no@spam.please> wrote in message news:<#5iHPlNRFHA.1476@TK2MSFTNGP09.phx.gbl>...
> how about html?
<snip>
> > All I want is to have editable text that can contain links. Thats all.
> > Char formatting etc isn't really an issue.
<snip>
0
perfnurt (11)
4/20/2005 2:38:39 PM
Reply:

Similar Artilces:

how to link to external worksheet
I am using excel 2003 and am trying to link a worksheet from one spreadsheet (source) into a second spreadsheet (destination). The source spreadsheet may or may not be open when accessing the link from the destination spreadsheet. I figured out to go to the source, select the whole sheet, ^c, then switch to a blank worksheet in the destination and Edit->Paste->Paste Special. From there I "Paste link", then paste "format" and "column widths". My first problem is that any blank cells on the source worksheet come over as 0's on the destination, ev...

Create Link to Dial-Up Network Item
Hello, I am using ishelllink to create links which is working, except I am struggling to get it to work with Dial-Up Networking entries. I can parse the namespace correctly and get the correct PIDL(matched with manual shortcut) for the item no problems, however passing the PIDL to SetIDList only creates a dead link. I have tried appending the PIDL's to make a PIDL relative to the Desktop to no avail. Any Ideas? I have never used COM objects before so I am lost for any. Any help would be greatly appreciated. Thanks. ...

Automatic links in Excel 2003
We are on XP with Office 2003, In Excel 2003 on a file created in Excel 2000 when user attempted to open the attached excel file in Excel 2003, she got prompt "the workbook contains automatic links to information in another workbook, do you want to update this workbook with changes made to the other workbook". No matter she chose "update" or "don't update", the data in "actual" column will disapper. Support agent helped her try to disable auto-update. (http://support.microsoft.com/default.aspx?scid=kb;en-us;288851). But we still get prompt...

Another Spin to Updating Links
Good Morning All, I posted yesterday in regards to a workbook that does not display the updated values from linked workbooks. Dave Peterson replied that I use the =SUMPRODUCT formula instead of the =COUNTIF formula, which did the trick. However I have run into a problem when I want to find a zero in one of the linked workbooks. In one of the linked workbooks I have the years 2000 to 2010 located in $A$1:$A:11, in which I have data in from $B$1:$B:$6 (which are the years 2000 to 2005). The remaining cells ($B$7:$B:$11 are blank). I want to find the number of occurences of 0's in $...

How to re-fresh the import links if it fails?
I would like to retry 5 times to retrieve data from import links if it fails to be retrieved. Does anyone have any suggestions on how to refresh the import links if it fails? Thanks in advance for any suggestions Eric ------------------------------------------------------------------------------------------ Dim qtEntry As QueryTable Dim qryConnect As String Dim anyRange As Range Dim anySheet As Worksheet Set anyRange = Sheets("1").Range("A1:" & _ Sheets("1").Range("A1").SpecialCells(xlLastCell).Address) On Error Resume Next ' err...

why are links to websites (inserted in publisher documents) disab.
why are links to websites and e-mailadresses (inserted in publisher documents) still working in emailpreview but disabled in webpage preview? ...

Linking textboxes with option boxes
I have a userform with a column of text boxes (TextBox1, 2, 3...10) and adjacent Check boxes (CheckBox1, 2, 3...10). The textboxes are populated from a sheet with various items. What I need is for the adjacent Check boxes to be checked if the textboxes contain either the text AAAAA or BBBBB and unchecked for anything else. Can anyone help? Many thanks, Roger And contains means that the textboxes can contain: xxxxxAAAAAyyyyy and still be checked, right? I only used 3 textboxes/checkboxes in this sample. You'll have to add 7 more _Change procedures: Option Expl...

Formatting of Excel OLEs in Word is messed up after updating links
I have a Word document with multiple Excel objects pasted and linked to their source files. Every time I try to update any of them, they revert to their original size they had when I first pasted them in, instead of the formatting I applied afterward. I've tried to fix this by editing the links, but the "Preserve formatting after update" box is greyed out on all of them. Is there another way to force these objects NOT to revert to original size every time I update? The way it is now sort of defeats the whole purpose of linking them in the first place. ...

rtf document linked to template can run macros without warning
trend micro security gave me this message. Trying to use patch to fix several times, but says cant find compatible devices to fix. "mike" <mike@discussions.microsoft.com> wrote in message news:BB3D77F4-BB54-437F-8BF6-9FF59FE98697@microsoft.com... > trend micro security gave me this message. Trying to use patch to fix > several times, but says cant find compatible devices to fix. This has what to do with Windows Update? Can't you numb nuts read? -- "Don't pick a fight with an old man. If he is too old to fight, he'll just kill you.&...

How to import a list of links into Excel?
Does anyone have any suggestions on how to import a list of links in to Excel? Under the sheet "Date", there is a list of http links under column C, and a list of name under column B, I would like to import each link into specific sheet at cell A1. For example, in sheet "Date", there is a link www.cnn.com in cell C2, and 1 in cell B2, so this link is imported into sheet "1", and keep running the rest of links. Does anyone have any suggestions on how to do it in Excel macro? Thanks in advance for any suggestions Eric Hi Eric If you have numerics in...

integration manager error: Scrolling window link table not on form
We've had this integration running for the last couple of years and today it stopped. I get this error: "DOC 1 ERROR: Scrolling window link table not on form." regardless of whether I run it on new or processed data. I think this causes the balance of the documents to fail. Here is the full log. Integration Log Integration: AR Sale Invoice Upload (ID: 41) Action: None Start Time: 8/16/2006 12:40:03 PM 8/16/2006 12:40:03 PM Source: IIntegrationEngine_Run, Status Code: 0 Opening source query... 8/16/2006 12:40:03 PM Source: IIntegrationEngine_Run, Status Code: 0 ...

Severing links to list names when moving sheets between workbooks
When I move sheets to another spreadsheet, is there a way to automatically sever the links so that it doesnt keep asking about list names? Can anyone advise of direct me? Thanks,Roger Roger, see if this works for you. Sub RemoveLinks() Dim Link As Variant With ActiveWorkbook For Each Link In .LinkSources .BreakLink Name:=Link, Type:=xlLinkTypeExcelLinks Next End With End Sub -- jb "Roger on Excel" wrote: > When I move sheets to another spreadsheet, is there a way to automatically &g...

linked Forms
I have a form linked to my main data entry form via a command button. How do i get it to display a "blank" or new form for data entry when I click the button and the form opens? Currently when the button is clicked it opens the form and it is displaying the first record and you have to click the add new or scroll all the way through the records in order to add a new one. =?Utf-8?B?U2FyYWhK?= <SarahJ@discussions.microsoft.com> wrote in news:A0B2C476-13EC-4F5D-A1E2-62183740DB4F@microsoft.com: > I have a form linked to my main data entry form via a command > button...

The missing link...
I have inherited a sheet from a larger workbook (moved and copied) which is now asking to update links on each Open. I don't want or need the link, though nor can I find it on the sheet. How can this be done? Good weekend! M. Edit - Links - delete any that show up ?? "Mourinho" wrote: > > I have inherited a sheet from a larger workbook (moved and copied) which is > now asking to update links on each Open. > > I don't want or need the link, though nor can I find it on the sheet. > How can this be done? > > Good weekend! > > M. Nope...

Creating links between spreadsheets
Is it possible to create links between spreadsheets based on &#8220;if/then&#8221; criteria? I have an invitation list for a party, and then an attendee list with a whole different layout/fields for the invitees who respond &#8220;yes&#8221;. Can I create a link from &#8220;Invitee&#8221; to &#8220;RSVP&#8221; list with &#8220;if RSVP = &#8216;yes&#8217; then link to &#8220;Attendee&#8221; list? Attendee actually becomes a third list, seating chart, would love to have diff layout for this as well. Any help appreciated concaf2003 ...

Edit Links in excel....Urgnet..
Hi, I have data in Excel file and I have linked to data in some other Excel File. Whenever I opened file I will not get automatically updated the links, every time it ask for edit link and also ask for data source to get link update. Please advice me... Best regards vishu ...

Problem clicking on url link in emails
I get a box that says "Locate link browser" and also the browser window. How do I get rid of the "locate link browser" box appearing whenever I click on a url link? Point it to IEXPLORE.EXE -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -What do the Outlook Icons Mean? -Create an Office 2003 CD slipstreamed with Service Pack 1 ----- "Robin" <robinhood2@juno.com> wrote in message news:hgl7l0hn8e8gjqgrmfuc0734s7ag6h7r0s@4ax.com... >I get a box that says "Locate link browser" and also the browser > window. &g...

Removing a Link
How do I remove a link to another worksheet? I have a workbook which has several sheets containing links to each other within the workbook only. The mistake I made is that I copied one of the sheets to a new file in order to email just that sheet to somebody. My problem now is that my original workbook will not function properly as it thinks it is linked to the new file that I no longer need and have since deleted. There does not seem to be a straightforward way to delete a link to another workbook. How do I get back to where I was originally? Any help would be greatly appreciated. Re...

Can't link a graphic?
Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC Email Client: pop I've been told on this forums several times that one cannot have a graphic with live link in your email signature. <br> Still, I've recently received a few email with small buttons that link to facebook and myspace in Entourage. How are these folks achieving this? thanks. kevs12@officeformac.com wrote: > Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Power > PC Email Client: pop I've been told on this forums several times that > one cannot ha...

Chart Location Impact On Links When Copying To New Workbook
I have a sheet in Excel that contains all of my data. I also have several charts based on thsi data. If the location for each of these sheets is "As New Sheet" then if I copy the data sheet and chart sheets to a new workbook then there are no links back to the original file (the chart source data references the data sheet in the new file). However, if the chart location for each of these charts is "As Object In" a worksheet, then when I select the data sheet and the worksheet that has all of the embedded charts and copy them to a new workbook, the charts create a ...

Visual Basic Help Links don't all work
Hi, all, I upgraded to Excel 2003 (and Office 2003) recently and am using WinXP (Service Pack 2). My problem? Many of the links in Visual Basic Help don't work. None of the ones that say "Visual Basic for Applications" in parentheses work Others that don't say that like "Understanding Visual Basic Syntax" also don't work. Others do work. I uninstalled VBA and reinstalled it and still no-go. Any help out there? Seems I'm missing something rather "basic" (pardon the pun). But the Help feature is a crucial one for me. Thanks, Pete ...

when clicking on link in email blank screen appears
when i use outlook express to read my emails and i try to go to a link in the mail the window changes to a blank screen. how do i fix this? thanks. deb You Cannot Open New Internet Explorer Window or Nothing Happens After You Click a Link: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q281679&sd=tech A good website for information on OE is: http://www.tomsterdam.com/ This is a group to support Outlook from the Office group of programs. Outlook Express is a part of Internet Explorer and is a quite different program, despite its similar name. You will probably get a faster ...

Images
I have a workbook with images inserted, and when I use Office Links to e-mail it via Outlook, the images are not cooperating. Whether sending the worksheet as the body of the e-mail, or sending it as an attachment, the images do not print. (comes up as a box with an x - won't load) Have tried embedded and linked. Should I be creating a hyperlink? These are not giant byte sized images, so I'm at a loss! Please help!! Thanks in advance! Beth ...

http link
i am using outlook 2002 and i got this http link from my friend is it any way i can just click below link then will open from intrnet explorer. right now i have copy and paste to internet explorer. please advice http://www.slipstick.com/outlook/share.htm liu <anonymous@discussions.microsoft.com> wrote: > i am using outlook 2002 and i got this http link from my > friend is it any way i can just click below link then > will open from intrnet explorer. right now i have copy > and paste to internet explorer. please advice > > http://www.slipstick.com/outlook/share.h...

Linked Graph Formatting
ng to openiHi I run Excel 2000 I have a workbook with a number of charts in it. These charts have data on 2 axis. The left axis has a bar chart with a calendar year label for each bar. The right axis is a line chart with a Calendar Month label under each data point. I copied these to a 2nd workbook so that when I update the charts in workbook 1, they automatically update in workbook 2. This works fine as long as I have both workbooks open at the same time. However, if only the 2nd workbook is open the Calendar Month labels under the line chart on axis 2 are no longer formatted to a d...