RICHEDIT / ActiveX control

I'm desparately trying to write an implementation of a Rich Text Box 
(RICHEDIT control) to use in an application but I think I will feel like I'm 
trying to cut down a forest with a pair of scissors if I write the whole 
application in C++, so I'm trying to create an MFC ActiveX control to use in 
..NET, and when I do - it pops up a nice little dialog box entitled 
"Application settings" saying "What type of control do you want to base your 
new MFC ActiveX control on?" Aaaah!! nice!! methinks.
But alas!
I find that the RICHEDIT control isn't in the list!
Why is this, and how can I get round it?
Is there ANY another way I can have a derived RICHEDIT control that I WRITE 
in C++, but USE in C#? I've been searching this issue for months and months 
with no luck, but it's so frustrating because I know it's possible - what's 
annoying is that I can do all the code involved, C++ code is no problem, I 
understand it well, I just can't hack the project configurational aspects of 
C++ - like the #include statements and the library linkage and getting 
everything in the right order, etc.

Any help anybody can give me?
0
9/1/2004 9:25:06 AM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
1497 Views

Similar Articles

[PageSpeed] 58

The RichEditCtrl is not an ActiveX, it is a windows control, i.e., you
communicate with it by sending it messages, just like a standard edit control.
It does not have COM interfaces, except some special interfaces (ITextServices
or something like that) that don't encompass the full functionality.

You might take a look at the TX Text Control.  It comes in both ActiveX and .NET
versions.  It's pricey, but there is no runtime licensing once you buy it.

Last time I looked at it, it was kind of buggy, but that was a couple of
versions ago.  The current version, v11, looks a lot better.


On Wed, 1 Sep 2004 02:25:06 -0700, Patty O'Dors
<PattyODors@discussions.microsoft.com> wrote:

>I'm desparately trying to write an implementation of a Rich Text Box 
>(RICHEDIT control) to use in an application but I think I will feel like I'm 
>trying to cut down a forest with a pair of scissors if I write the whole 
>application in C++, so I'm trying to create an MFC ActiveX control to use in 
>.NET, and when I do - it pops up a nice little dialog box entitled 
>"Application settings" saying "What type of control do you want to base your 
>new MFC ActiveX control on?" Aaaah!! nice!! methinks.
>But alas!
>I find that the RICHEDIT control isn't in the list!
>Why is this, and how can I get round it?
>Is there ANY another way I can have a derived RICHEDIT control that I WRITE 
>in C++, but USE in C#? I've been searching this issue for months and months 
>with no luck, but it's so frustrating because I know it's possible - what's 
>annoying is that I can do all the code involved, C++ code is no problem, I 
>understand it well, I just can't hack the project configurational aspects of 
>C++ - like the #include statements and the library linkage and getting 
>everything in the right order, etc.
>
>Any help anybody can give me?

0
none89 (807)
9/2/2004 11:44:06 AM
select Edit in wizard and change the window class name to "richedit"
manually
you can still access the edit control by converting COleControl* to
CRichEditCtrl*.
CRichEditCtrl& CMyEditCtrl::GetRichEditCtrl( ) {return
*((CRichEditCtrl*)this);}

"Patty O'Dors" <PattyODors@discussions.microsoft.com> д���ʼ�
news:50A0F5FB-5577-4199-A5CD-8163C3487FBA@microsoft.com...
> I'm desparately trying to write an implementation of a Rich Text Box
> (RICHEDIT control) to use in an application but I think I will feel like
I'm
> trying to cut down a forest with a pair of scissors if I write the whole
> application in C++, so I'm trying to create an MFC ActiveX control to use
in
> .NET, and when I do - it pops up a nice little dialog box entitled
> "Application settings" saying "What type of control do you want to base
your
> new MFC ActiveX control on?" Aaaah!! nice!! methinks.
> But alas!
> I find that the RICHEDIT control isn't in the list!
> Why is this, and how can I get round it?
> Is there ANY another way I can have a derived RICHEDIT control that I
WRITE
> in C++, but USE in C#? I've been searching this issue for months and
months
> with no luck, but it's so frustrating because I know it's possible -
what's
> annoying is that I can do all the code involved, C++ code is no problem, I
> understand it well, I just can't hack the project configurational aspects
of
> C++ - like the #include statements and the library linkage and getting
> everything in the right order, etc.
>
> Any help anybody can give me?


0
sheng_jiang (305)
9/2/2004 8:54:49 PM
Couldn't get it to work. I did what you said, but it asserts on this line

	ASSERT(m_hWnd != NULL);

which is the last line in the function

BOOL COleControl::CreateControlWindow(HWND hWndParent, const CRect& rcPos,
	LPCRECT prcClip)


Thanks for responding but please explain it - I'm quite weak at the 
configurational aspects of C++. I'm completely dumb as to what to do.
0
9/3/2004 8:13:02 AM
Oh - I got it to at least initialize properly by calling AfxRichEditInit() in 
the constructor - it still doesn't work properly though. When I put it into 
ActiveX control test container, I get that issue whereby when you resize it 
bigger, the old border stays. And it doesn't display characters, just a 
series of lines, like the pipe character, where the characters should be. I 
haven't added any code.
Please help!
Thanks

"Jiangsheng[MVP of VC++]" wrote:

> select Edit in wizard and change the window class name to "richedit"
> manually
> you can still access the edit control by converting COleControl* to
> CRichEditCtrl*.
> CRichEditCtrl& CMyEditCtrl::GetRichEditCtrl( ) {return
> *((CRichEditCtrl*)this);}
> 
> "Patty O'Dors" <PattyODors@discussions.microsoft.com> дÈëÓʼþ
> news:50A0F5FB-5577-4199-A5CD-8163C3487FBA@microsoft.com...
> > I'm desparately trying to write an implementation of a Rich Text Box
> > (RICHEDIT control) to use in an application but I think I will feel like
> I'm
> > trying to cut down a forest with a pair of scissors if I write the whole
> > application in C++, so I'm trying to create an MFC ActiveX control to use
> in
> > .NET, and when I do - it pops up a nice little dialog box entitled
> > "Application settings" saying "What type of control do you want to base
> your
> > new MFC ActiveX control on?" Aaaah!! nice!! methinks.
> > But alas!
> > I find that the RICHEDIT control isn't in the list!
> > Why is this, and how can I get round it?
> > Is there ANY another way I can have a derived RICHEDIT control that I
> WRITE
> > in C++, but USE in C#? I've been searching this issue for months and
> months
> > with no luck, but it's so frustrating because I know it's possible -
> what's
> > annoying is that I can do all the code involved, C++ code is no problem, I
> > understand it well, I just can't hack the project configurational aspects
> of
> > C++ - like the #include statements and the library linkage and getting
> > everything in the right order, etc.
> >
> > Any help anybody can give me?
> 
> 
> 
0
9/3/2004 8:19:06 AM
Usually, you need to override PreCreateWindow and change richedit window
styles.

"Patty O'Dors" <PattyODors@discussions.microsoft.com> д���ʼ�
news:743C2780-24F3-48C7-8257-8627B59418E0@microsoft.com...
> Oh - I got it to at least initialize properly by calling AfxRichEditInit()
in
> the constructor - it still doesn't work properly though. When I put it
into
> ActiveX control test container, I get that issue whereby when you resize
it
> bigger, the old border stays. And it doesn't display characters, just a
> series of lines, like the pipe character, where the characters should be.
I
> haven't added any code.
> Please help!
> Thanks
>
> "Jiangsheng[MVP of VC++]" wrote:
>
> > select Edit in wizard and change the window class name to "richedit"
> > manually
> > you can still access the edit control by converting COleControl* to
> > CRichEditCtrl*.
> > CRichEditCtrl& CMyEditCtrl::GetRichEditCtrl( ) {return
> > *((CRichEditCtrl*)this);}
> >
> > "Patty O'Dors" <PattyODors@discussions.microsoft.com> дÈëÓʼþ
> > news:50A0F5FB-5577-4199-A5CD-8163C3487FBA@microsoft.com...
> > > I'm desparately trying to write an implementation of a Rich Text Box
> > > (RICHEDIT control) to use in an application but I think I will feel
like
> > I'm
> > > trying to cut down a forest with a pair of scissors if I write the
whole
> > > application in C++, so I'm trying to create an MFC ActiveX control to
use
> > in
> > > .NET, and when I do - it pops up a nice little dialog box entitled
> > > "Application settings" saying "What type of control do you want to
base
> > your
> > > new MFC ActiveX control on?" Aaaah!! nice!! methinks.
> > > But alas!
> > > I find that the RICHEDIT control isn't in the list!
> > > Why is this, and how can I get round it?
> > > Is there ANY another way I can have a derived RICHEDIT control that I
> > WRITE
> > > in C++, but USE in C#? I've been searching this issue for months and
> > months
> > > with no luck, but it's so frustrating because I know it's possible -
> > what's
> > > annoying is that I can do all the code involved, C++ code is no
problem, I
> > > understand it well, I just can't hack the project configurational
aspects
> > of
> > > C++ - like the #include statements and the library linkage and getting
> > > everything in the right order, etc.
> > >
> > > Any help anybody can give me?
> >
> >
> >


0
sheng_jiang (305)
9/4/2004 11:54:58 PM
It's still doing the same thing.
 My PreCreateWindow is:
BOOL CMFCRTB2Ctrl::PreCreateWindow(CREATESTRUCT& cs)
{
	cs.lpszClass = RICHEDIT_CLASS;
	cs.style |= (WS_CHILD | WS_VISIBLE | ES_SUNKEN | ES_MULTILINE);
	BOOL success = COleControl::PreCreateWindow(cs);
	return success;
}

It doesn't even display any mouse pointer when you mouse over it - it's just 
grey.

"Jiangsheng[MVP of VC++]" wrote:

> Usually, you need to override PreCreateWindow and change richedit window
> styles.
> 
> "Patty O'Dors" <PattyODors@discussions.microsoft.com> дÈëÓʼþ
> news:743C2780-24F3-48C7-8257-8627B59418E0@microsoft.com...
> > Oh - I got it to at least initialize properly by calling AfxRichEditInit()
> in
> > the constructor - it still doesn't work properly though. When I put it
> into
> > ActiveX control test container, I get that issue whereby when you resize
> it
> > bigger, the old border stays. And it doesn't display characters, just a
> > series of lines, like the pipe character, where the characters should be.
> I
> > haven't added any code.
> > Please help!
> > Thanks
> >
> > "Jiangsheng[MVP of VC++]" wrote:
> >
> > > select Edit in wizard and change the window class name to "richedit"
> > > manually
> > > you can still access the edit control by converting COleControl* to
> > > CRichEditCtrl*.
> > > CRichEditCtrl& CMyEditCtrl::GetRichEditCtrl( ) {return
> > > *((CRichEditCtrl*)this);}
> > >
> > > "Patty O'Dors" <PattyODors@discussions.microsoft.com> дÈëÓʼþ
> > > news:50A0F5FB-5577-4199-A5CD-8163C3487FBA@microsoft.com...
> > > > I'm desparately trying to write an implementation of a Rich Text Box
> > > > (RICHEDIT control) to use in an application but I think I will feel
> like
> > > I'm
> > > > trying to cut down a forest with a pair of scissors if I write the
> whole
> > > > application in C++, so I'm trying to create an MFC ActiveX control to
> use
> > > in
> > > > .NET, and when I do - it pops up a nice little dialog box entitled
> > > > "Application settings" saying "What type of control do you want to
> base
> > > your
> > > > new MFC ActiveX control on?" Aaaah!! nice!! methinks.
> > > > But alas!
> > > > I find that the RICHEDIT control isn't in the list!
> > > > Why is this, and how can I get round it?
> > > > Is there ANY another way I can have a derived RICHEDIT control that I
> > > WRITE
> > > > in C++, but USE in C#? I've been searching this issue for months and
> > > months
> > > > with no luck, but it's so frustrating because I know it's possible -
> > > what's
> > > > annoying is that I can do all the code involved, C++ code is no
> problem, I
> > > > understand it well, I just can't hack the project configurational
> aspects
> > > of
> > > > C++ - like the #include statements and the library linkage and getting
> > > > everything in the right order, etc.
> > > >
> > > > Any help anybody can give me?
> > >
> > >
> > >
> 
> 
> 
0
9/6/2004 10:43:01 AM
Reply:

Similar Artilces:

Email view control
Is there a way to control wether an email is printed or screen shot? i need some way to prevent an email form being forwarded printed or screenshot. any ideas? Wow. I don't know of anything that will plug the analog hole like that...(screen to eyes). EVen if sent encrypted, it has to be un-encrypted at some point..... we could hack the retinal nerve, and send the image directly to the brain.... <neondemon@gmail.com> wrote in message news:1170876046.268523.217910@s48g2000cws.googlegroups.com... > Is there a way to control wether an email is printed or screen shot? i >...

Multipage, controls-collection and events (XL2003, VBA)
Dear Group, I have a Userform with a Multipage control, which is dynamically filled with textboxes and comboboxes using Controls.Add like this: Set aTextBox = aUserForm.aMultiPage.Pages(strCurrentRegister).Controls.Add("Forms.TextBox.1", "txt" & strText, True) Set aComboBox = aUserForm.aMultiPage.Pages(strCurrentRegister).Controls.Add("Forms.ComboBox.1", "txt" & strText, True) This is working fine, but what I miss is any way to assign eventhandlers. Is there any way to do this? If not, I could use existing controls, which...

Tab controls/ Hiding Tabs
I am looking for some coding assistance. I have a tab control called "Master Tab" with 3 tabs on it called "Type" "CIP" and "Vacuum". When I load the tab control form I want "CIP" and "Vacuum" to be hidden - only "Type" should be showing. Then when I want to go to the "CIP" tab, I would like to create an event that hides the "Type" form and makes the "CIP" form visible. Any ideas? Thanks, Zag -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms...

looking for control to display dialog similar to VC++ option window
I would like to implement a dialog similar to the VC++ options window. The left pane of the options windows contains a tree control used to select various options that will be viewed/edited. The right side of the options window displays an dialog that allows the user to view/edit information/data for the selected option. Are there any shareware/commercials controls availabled that provide this functionality? Thanks in advance. Ian Ian wrote: > I would like to implement a dialog similar to the VC++ options window. The > left pane of the options windows contains a tree con...

Breaking the 30,000 character limit in a CString/CEdit control
I have a multiline CEdit control in a modal dialog. I find that even though no Maximum Characters is set and there is no call to DDV_MaxChars() in DoDataExchange(), there is a limit of 30000 characters that can be pasted or entered. My problem is fixed on Windows 2K if I add a higher Maximum Characters. I'd like a megabyte of text or so, but can live with 100K. Will this work on Win95/Me/98/XP? Or is there a problem with more than 32K or 64K characters in a CString there. MFC is statically linked in the app. Thanks for all replies. --Mike >My problem is fixed >on Windows 2...

Remote control volume indicator
How do I restore the green volume indicator bar graphic to my desktop? We need a little more info to offer any help. What version of Media Center? Do you mean that when you are in Media Center (watching a TV show. for example) and you press the Vol +/-, you don't see the indicator at the top right of the screen? .... or are you talking about some other volume indicator that is specific to your model PC? -- James Wolf [MS-MVP] Orlando, FL "swordfisch" <swordfisch@discussions.microsoft.com> wrote in message news:4A114587-B699-4520-BD0F-0F11246F79B7@...

Can't see calculated control
I have a calculated control on a report called txttotalID with a record source which is =YTDValue("txtMonth","CountofID","qrypurpose",[txtmonth]) The YTDValue refers to a Module taht calculates YTD figures The rpeorts record source is qrypurpose and the query has the fileds txtmonth and CountofID and that works fine and gives me a value.. I have another calculated control called TotalID where the record source is =Sum([txttotalID]), the txttotalID being my first calculated control. However, when I run the report I get a prompt asking for the value of tx...

WorkBook Tab display mode of SpreadSheet control in VB 6.0
the default display mode of SpreadSheet control in VB 6.0 is a dropdown list, as you know. Is it possible to display the WorkBook Tab of SpreadSheet control in VB 6.0 horizontally? like the display mode of SSTab. thanks On 02/07/2010 09:44, sunlite wrote: > the default display mode of SpreadSheet control in VB 6.0 is a dropdown list, > as you know. No I don't know, I've never heard of the Spreadsheet control. > Is it possible to display the WorkBook Tab of SpreadSheet control in VB 6.0 > horizontally? like the display mode of SSTab. Again, try asking...

Single handler for multiple controls
I think I want what, in VB, is called a Control Array. I know it can be done in VC++6 but I don't know the details of how. I have a dialog with buttons for the days of the month. I want a single handler for all of the buttons which will recieve the control Id of the actual button that was pressed. How do I achieve this? TIA, --- Al. you can use the ON_COMMAND_RANGE(commandid_start, commandid_end, commandhandler) message map for this. the prototype of the command handler is void OnMyButtons(UINT nID). the function paramer nID will contain the ID of the selected button. > you can...

what type is calendar control
running Excel 2003 (going to 2007 in the next few months) I have inserted a pop-up calendar (Insert/Object.../Calendar Control 11.0). No problems getting it to do what I want - except when I declare my variables (Option Explicit). I can't seem to determine what type the Calendar object is - Dim Calendar as Object returns a "Block Not Set" error. Any sugegstions? Art You put this calendar control directly on the worksheet, not a UserForm, correct? I think you can do it this way... Dim MyCalendar As Object Set MyCalendar = Worksheets("Sheet2").OLEOb...

Converting Activex application
Hi All, I have a activex application developed in VC++6.0(wtl,atl) that runs in IE. I'm planning to convert this application to .Net3.5(VS2008) in C# or VC ++.net How to convert and which one(C# or VC++) is better Thanks, Sony On Mar 24, 7:48=A0pm, SM <sony.m.2...@googlemail.com> wrote: > Hi All, > I have a activex application developed in VC++6.0(wtl,atl) =A0that runs > in IE. > I'm planning to convert this application to .Net3.5(VS2008) in C# or VC > ++.net > How to convert and which one(C# or VC++) is better > > Thanks, > Sony ...

Control data association in double-y chart
I'm trying to make a double y-axis chart where three data sets appear on (are associated with) one axis and the fourth data set is associated with the other. By every method of data import that I've tried, the data sets are split two and two for each of the y-axes. Can anyone help me I'm using the Lines on 2 Axes Chart Type from the Built In Custom Type list. If I could do a double-y chart using a x-y scatter chart, it would be even better. Thanks for any help --Mike Mike - Who needs the built-in custom types? Make your XY Scatter chart with all the data, then double click ...

ActiveX inside ActiveX
Hi All, Can I Include an ActiveX Control in my project which itself is an ActiveX Control. Thanks in Advance Regards Jayasankar ...

Which Control has the Focus??
Is there a way (Software-wise) you can determine which control on a form currently has the Focus?? Thanks, ken Take a look at ActiveControl in VBA's help. I put a bunch of controls on a userform, then used this code to display the activecontrol's name: Option Explicit Private Sub CommandButton1_Click() MsgBox Me.ActiveControl.Name End Sub Private Sub UserForm_Initialize() With Me.CommandButton1 .TakeFocusOnClick = False End With End Sub Ken Soenen wrote: > > Is there a way (Software-wise) you can determine which control on a form > currently has...

Control ID
How do you, programatically, get the ID of a control. Example an edit box. Something like... this->GetData(IDC.....) Thanks Hi, If you have the controls HWND or CWnd*, you can use GetWindowLong with GWL_ID as the index. Hope this helps Chris Taylor " JCO" <J.Oliviero@verizon.net> wrote in message news:yKp3b.15522$Jq1.5792@nwrddc03.gnilink.net... > How do you, programatically, get the ID of a control. Example an edit box. > Something like... > > this->GetData(IDC.....) > > Thanks > > Take a look at the GetDlgCtrlID() API. -- Cheers...

Control Version Question
Hi guys, I've been fooling around with the NM_CUSTOMDRAW notification message for my CListCtrl objects. It says that it requires version 4.70 (or higher) of the common controls; I use VC++ 6.0 (SP5) with the latest Platform SDK on Win XP Pro and it works fine. But I am wondering if it will work on older Windows, like Win 9x. I don't understand if it's me that has to have the correct version or the user; if I have the correct version and compile it will it work on the older systems ? I never really understood this. Take care, Robert A. Robert A. wrote: > Hi guys, > >...

Error: "A problem communicating with OLE server or ActiveX Control
After rebooting, I started receiving the following message when I open my Access program or any Access database. "A problem occurred while Microsoft Office Access was communicating with the OLE server or ActiveX Control". I rebooted due to a prompt for our network manager for system updates. At first I thought my issues were due to a possible windows update patch or something. But I seem to be the only one having this issue. I did not have any issues with Access before the rebooted. Since the error occured I've: *Rebooted several times *Repaired my Offic...

How to control line spacing in Outlook Notes ?
When I paste some stoff into Outlook 2003 Notes it often appears double spaced. I can force a soft return at the end of each line and get it to change back to single spaced but that is a pain. Under Format | Paragraph I don't see the options of setting line spacing. How can I make Select Text in Outlook Notes and force it back to single spacing? thanks for any help. ...

Calculated control event order
Apologies if this shows up more than once - thought I had it posted but it's not showing up. I have a calculated control on a subform whose value I need to "copy" to a bound control on the main form. Can't just use [main form]!boundcontrol =subform!calccontrol because the bound control needs to be able to be edited at the users discretion (ie. the calculated value is a 'suggestion' that may or may not be what the user wants.). I can't find an event that is triggered by a change in value of a calculated field that will allow me to use code to sen...

i'M TRYING TO CREATE A cONTROL CHART USING A WIZARD.
Could you direct me as to where I can purchase a guide to QI macros (text) to explain each parameter, etc., as well as how to create control charts. I will need to be teaching this material. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/offi...

Best RAID config for 600 users, have (5) 70Gig 15K RPM drives on 2 controllers
Just got my Dell Dual 3Ghz xeon server (4mb cache), 6Gig RAM. It has five 15K RPM 70gig drives, 2 drives on one raid channel, and 3 drives on the other. Dell made C: raid 1 and d: raid 5. This leaves me with no hot spare. Since I only have 600 users and very fast drives, my idea was the following: RAID 5 (3 drives) paritioned as C: for the OS and D: for the data. 1 drive for backup to disk, in addition to backup to tape. 1 drive as a hot spare. I'd like to know what others think about this config. Thanks NH Hi, Try this article download.microsoft.com/download/f/b/5/fb5efeef-52ac-4ea4...

Suggest technique for a totals control based on subform
I have a SalesDetails subform on which user selects various services to be installed. The choices are looked up from a tblSalesCodes. We have an install fee which is $19.95 for first services and 9.95 for each subsequent service. The service choices includes both individual and bundled services. What I mean by this is that user could select a choice that has 1 service, and therefore the install fee is $19.95. Or they could select a choice that has 2 service, so install fee is $29.90. Or they could select 2 choices, each with one service, so it's $29.90. On tblSalesCodes, I have e...

Microsoft Web Browser Control background color?
Greetings, I am using the CHtmlView which I believe is using the Microsoft Web Browser Control. I can't figure out how to change the background color while in an html view so that if a web page isn't assigned to the control it won't default to white. Instead use a different color is there way to change this? Thanks in advance for any suggestions! I dont see how you can do this w/o the IWebBrowser2 contained in the CHTMLView knowing about it. You can do it by style sheets, scripts etc, all the HTML based technology behind it; but not thru Win32 or MFC directly. -- Ajay Kal...

Add Controls at Runtime with Events
I need to add a series of controls at runtime in Excel that I can interact with via events. How do I do this? Specifically, my program automatically queries a database every five minutes to update it's information. The information is constantly changing. For each record in the database, the program creates a row of info on an Excel worksheet. I want to be able to create a command button and label for each record on the worksheet. How would I accomplish this? Thanks in advance! Try something like the following code Dim OLEObj As OLEObject Dim Rng As Range Dim WS As Worksheet Dim C...

Virtual list control #2
Needed to use it. Very simple and straighforward, and I am mostly happy with it, with the exception that scrolling is slower than I had hoped. I did expect scrolling to be slower, but not that much slower. Population and scrolling are fantastic compared with standard list of course. Actually, I can live with the vertical scrolling. I was disappointed to run sample apps, and see how bad horizontal scrolling was. Looking at the messages, the LVN_GETDISPINFO message is sent for every single cell in the visible rows, whether they are in visible columns or not. Well, OK, I can live with that, *ex...