switching CRichEditCtrl to single line mode

Hi all,

I have a dialog with a rich edit box (CRichEditCtrl).
I need to set it to single line mode. I cannot do that in the resource 
editor,
because I want to use the same dialog in both singleline an multiline mode,
depending on the program logic.

I tried this:

from the  OnInitDialog() I called
m_ctrl_text.ModifyStyleEx(ES_MULTILINE, 0, 0);

did not help.

then I tried to handle  ON_WM_CREATE()

like this:


BEGIN_MESSAGE_MAP(QMyRichEditCtrl, CRichEditCtrl)
 //{{AFX_MSG_MAP(QMyRichEditCtrl)
 ON_WM_CREATE()
 //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// QMyRichEditCtrl message handlers

int QMyRichEditCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 AfxMessageBox(_T("hi"));
 return CRichEditCtrl::OnCreate(lpCreateStruct);
}

but th handler does not get called.

Any ideas please?

Thank you
Vaclav


0
no1498 (362)
6/5/2006 12:16:03 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
512 Views

Similar Articles

[PageSpeed] 45

"Vaclav" <no@spam.please> wrote in message 
news:OTu5PnJiGHA.4416@TK2MSFTNGP02.phx.gbl...
> Hi all,
>
> I have a dialog with a rich edit box (CRichEditCtrl).
> I need to set it to single line mode. I cannot do that in the resource 
> editor,
> because I want to use the same dialog in both singleline an multiline 
> mode,
> depending on the program logic.
>
> I tried this:
>
> from the  OnInitDialog() I called
> m_ctrl_text.ModifyStyleEx(ES_MULTILINE, 0, 0);
>
> did not help.
>

Many control styles can not be changed after creation. This must be one of 
them.

> then I tried to handle  ON_WM_CREATE()
>
> like this:
>
>
> BEGIN_MESSAGE_MAP(QMyRichEditCtrl, CRichEditCtrl)
> //{{AFX_MSG_MAP(QMyRichEditCtrl)
> ON_WM_CREATE()
> //}}AFX_MSG_MAP
> END_MESSAGE_MAP()
>
> /////////////////////////////////////////////////////////////////////////////
> // QMyRichEditCtrl message handlers
>
> int QMyRichEditCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
> {
> AfxMessageBox(_T("hi"));
> return CRichEditCtrl::OnCreate(lpCreateStruct);
> }
>
> but th handler does not get called.
>

Control member variables are attached to the dialog control's HWND after 
creation. The WM_CREATE message has already come and gone by the time this 
happens.

> Any ideas please?

Re-Create the control?

-- 
Jeff Partch [VC++ MVP]



0
jeffp (1712)
6/6/2006 1:55:59 AM
Reply:

Similar Artilces:

Print Preview crashes in Release mode
In Debug mode, the Print Preview works find but in Release mode, the program crashes (unhandle exception) before OnPreparePrinting is called by the framework. The application is a MDI using a FormView. Does anybody have an idea what the heck is going on? John It can be due to a number of reasons. You might want to take Dr. Watson help. In many cases, it gives the call stack will tell you where exactly the crash occured. Click Start->Run. Type drwtsn32 to launch it. Select full crash dump and visual notification. Now try repeating your crash. Examine the log file which Dr. Watson creates...

Can you switch a documnet from a poster to a letter?
Once you created a poster can you resize it to a letter? I know that you can resize the paper, but the test remains poster size. I would create a .pdf file with that poster and then using Reader, print and scale it down to letter size. -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/KB/555375 "o2binny" <o2binny@discussions.microsoft.com> wrote in message news:B7EC493A-5E9E-4485-A710-9C5748010316@microsoft.com... > Once you created a poster can you resize it to a letter? I know that you > can > resize th...

So why are YOU switching or not switching to Quicken?
I have seen many posts from users who have switched to Quicken and others who have no plans at all to switch to Quicken. I have used MS Money for 10 years and didn't activate Money Plus until this year so I will get updates until the bitter end in Jan 2011. I'm hoping this thread will be useful to discuss reason(s) to switch or not switch that people might not have thought of by themselves. So here the reasons I have come up with for why someone would or would not switch to Quicken. What's yours? Reasons for switching - Upset Microsoft discontinued Money - Your onlin...

Have switched to Apple Mail!
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange Too many problems with syncing, missing email, etc. etc. <br><br>I've now switched to Apple Mail and it works WAY better! How easy was it to transfer all your old email and folders? 2008 was a big disappointment for me because I only got 1 minor feature I was waiting for (thesaurus access) and the HTML editing that nearly everyone asked for since 2004 came out was still missing. In fact, like Office 2007 on the PC, the user interface (in the other office applicat...

how do i send email through outlook2003 from command line
anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com> wrote: See Help in Outlook, using "command line" as the search string. -- Brian Tillman ...

Problem with single user
Hi, I have a problem with a client where ibe user (out of 40 odd) can not receieve emails. She can send fine. Any mails that she receives stay in the Local Delivery queue. As I say, everyone else is fine. If I look at the event info in the tracking centre and view one of the emails I get the following: Message Submitted to Advanced Queueing Started Message Submission to Advanced Queue Message Submitted to Categorizer Message Categorized and Queued for Routing Message Queued for Local Delivery Message Delivered Locally to <email address> Message Scheduled to Retry Local Delivery...

script to count the number of mailboxes on all storage groups on a single mail server?
Gurus, Is there a script I can run which can count the number of mailboxes on all storage groups on a single mail server? i don't know about a script, but there are tools like csvde and ldifde that will allow you to create files with lots of fields that can be sorted on in Excel... "Spin" <Spin@spin.com> wrote in message news:3sfmg8Fo2luoU1@individual.net... > Gurus, > > Is there a script I can run which can count the number of mailboxes on all > storage groups on a single mail server? > > ...

/3gb switch
On 2 brand new Exchange 2003/Windows 2003 installs, I have modified the boot.ini file to include the /3GB /USERVA=3030 Exactly as instructed on the knowledgebase. However, I still recieve the memory settings warning whenever the servers boot up. Any ideas? The following KB article should guide you through some other settings that can be modified to optimize memory usage. http://support.microsoft.com/default.aspx?kbid=815372&product=exch2003 -- Ben Winzenz Exchange MVP "Jorge Azcuy" <Jorge Azcuy@discussions.microsoft.com> wrote in message news:25EA3E6F-C66F-478A-...

Email Duplication for single user only
I have having a problem with a single user that is receiving a duplicated email off another user everytime its sent. This is the only one it happens too but it's consistent every time.The sender is only sending to one email address no aliases no cc, bcc etc. This is happening on MS outlook 02, pop3 accounts. within the network. ...

How to print one single record from a Report in Access 2007?
Is it possible to print a single record from a Report in Access 2007? Is it possible to print selected records (ex. Record 1,3, 7) from a Report in Access 2007? "hsmonsivais" wrote: > Is it possible to print a single record from a Report in Access 2007? > > Is it possible to print selected records (ex. Record 1,3, 7) from a Report > in Access 2007? By the way I am currently learning how to use Access. I would appreciate if the responses are not too technical. Thank You. ...

Moving average trend line
For an XY scatter chart with a 30 day moving average trend line, the trend line extends 30 days beyond the end of the actual data. Is there a way to prevent this? Excel 2003, SP3 Thanks, Don Culp Hi, This only happens if the X-axis extends past the last data point, so at least one way to eliminate the problem is to double-click the x-axis and on the Scale tab set the Maximum to the last date you want plotted. A second way is to calculate the moving average in the spreadsheet and plot it as a separate series. If this helps, click the Yes button. Cheers, Shane Devenshire "D...

switching to windows 7
switching to windows 7, still need to have access to old e-mails. how can i access e-mails created in outlook express? Copy the ***ENTIRE*** OE message store to flash or CD. Do not copy individual dbx files. Put the copy of the message store on the Win7 Desktop. Open WLMail and File | Import | Messages | Outlook Express and point to where you saved them. -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "Jessica" <jstech@optonline.net> wrote in message news:uOEamPygKHA.1112@TK2MSFTNGP04.phx.gbl... > switching to windows 7, ...

switching
I am considering switching to MAC I recently bought Office for my PC. Do i have to re-purchase for MAC or are there any program from Microsoft to assist so i do not incur the double cost? thanks David In article <221401c49ca8$945b59b0$a401280a@phx.gbl>, "David Knopf" <knopfd@woh.rr.com> wrote: > I am considering switching to MAC > > I recently bought Office for my PC. > > Do i have to re-purchase for MAC or are there any program > from Microsoft to assist so i do not incur the double > cost? Unfortunately, there's no discount/switch ...

switching from outlook express to outlook
I keep getting a mail delivery error, either saying "password required" or "the operation was cancelled". I've tried all combinations in the properties section of the account, to no avail. Of course, Express asks me for a password before kicking in. Any suggestions? "Barrie" <bhharry@telus.net> wrote in message news:05eb01c39539$a1626300$a401280a@phx.gbl... > I keep getting a mail delivery error, either > saying "password required" or "the operation was > cancelled". I've tried all combinations in the properties >...

start IE in protected mode
I have vbscript that starts IE with Set oIE = CreateObject("InternetExplorer.Application"). How do I do the same but in protected mode? Thank, LJB IE "Protected Mode" is only available and on by default in Vista and up because it is based on new security features in those OSs. "LJB" wrote: > I have vbscript that starts IE with Set oIE = > CreateObject("InternetExplorer.Application"). How do I do the same but in > protected mode? > > Thank, > LJB > > > . > LikeToCode wrote: > IE &quo...

Single option button
Is it possible to add a single option button for a customized field? In the settings section I can only find a Boolean type for this. Thanks in advance! Hi, No, the check box is not available in this version ans I did'nt heard in next too. Sylvie "Jytte Diederiks" wrote: > Is it possible to add a single option button for a > customized field? In the settings section I can only find > a Boolean type for this. > > Thanks in advance! > ...

HELP. 2 Emails in 03' and need to switch them.... want new email M
Help! I have just added second email acct to 2003 + want new acct to appear so its connected to contacts,calendar,outbox... I'm unsure of how to explain it.... but I'll try. Note: I have already made this email account my default account. Currently, my view looks like this in "all mail folders" view under Mail in navigation pane: +Personal Folders Deleted items Drafts +Inbox ****(This is the inital email, and under OUTLOOK TODAY, THIS email account comes under inbox (seen under "messages" in Outlook Today.)**** Junk Email ...

User Switch
XP, Home Edition ,SP3 Hello! Somehow thru my own judgment error I have managed to become a Computer Administrator..Prior to today I would go directly to the desktop and begin using my PC..Now I find myself having to allow the computer to load my personal settings..I would like to go back to the default(?) I had but I have scoured the options to go back and I don't know how..I am anxious to go back to what I had..I have never shared my computer so I guess I am ignorant about switching users...Thanks so Much...Nick Run System Restore to a time before the problem began. ...

CRM3 Error when going off line 04-17-06
Just installed the 'offline' version of the Outlook CRM client on my laptop. I am using CRM without Exhange. Whenever I try to take the laptop offline and click the 'go offline' button I am getting the error: "Failed move data for entity 'E-mail' during action saInsert, countRows=161. Contact your system administrator for assistance and try going offline again" Have tried going again with no luck any idea on what I should be doing to fix the error? TIA Antony We are getting this error too. Any chance you were able to resolve this? Thanks. Bump... Anyone g...

C#: XYScatter chart with smooth lines and no markers
I hv been working on a Office 2007 App level add-in project using VS2005, ..Net 2.0, VSTO for Office 2007 and Office 2007 Interopps. I want to draw a XYScatter chart with smooth lines nad no markers. Why, even if we set the ChartType to xlXYScatterSmoothNoMarkers you get markers? xlChart.ChartType = Microsoft.Office.Interop.Excel.XlChartType.xlXYScatterSmoothNoMarkers; Is there any way to change XYScatter line thickness? OK....I got this matter solved after trying several combinations. We can use Chart.ChartWizard() method, where in parameters we can mention the chart type we wa...

Excel 2007 Line Chart with Markers
I'm using a Line Chart With Markers tracking 4 data lines: Red with Circles Black with Squares Blue with Diamonds Yellow with Triangles The yellow with triangles is very light and doesn't show very well in my PP presentation. I would like to change the color of just that one line. How do I do that? Click on that series in the chart, and right click, format series. You should now be able to change the color of the series. -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Bishop" wrote: > I'm using a Line Chart With Markers...

how could i capture the event when my computer switch display device?
laptop could redirect the display output to another device by pressing Fn + special key, how could i know this happened? i have searched msdn for sometime, hanvn't found any window message related. does anyone know ? "thinktwice" <memorialday@gmail.com> wrote in message news:ea3d8cfa-2c80-445f-899e-630ec0bd9239@a8g2000prf.googlegroups.com... > laptop could redirect the display output to another device by pressing > Fn + special key, how could i know this happened? i have searched msdn > for sometime, hanvn't found any window message related. does anyone > ...

Problems switching to new hardware
after removing active directory from the machine, I tried to activate it as a 2nd machine for the new Dell machine. No luck, it still could not locate the machine. After tinkering around I finally gave up and reinstalled the OS on the new machine from scratch. I recreated the user list and also installed the email server. We're up and running again. I only have one problem left. Our old domain was server1.xxx.org. The new domain I created was just xxx.org. So now anytime we try to access the external web site from our provider called xxx.org I don;t get it. I've tried to use the DNS ma...

how can i get a "Column
Under Chart type... there is a built-in category....i see that it has line-column on 2 axes..but i wanted to know if its possible to have it the other way around... that is: One column and 2 Lines showing on my graph. Help? please Those built-in custom charts are occasionally helpful, unless you want something different. Build the combination chart yourself. Create a line chart with all of your data, then select the series you want to display as columns, go to Chart menu > Chart Type, and choose a column type for this selected series. If you want any series on the secondary axis, d...

Lining stuff up
Using Publisher 2007. Why is it that when I have successive paragraphs using numbering, they look right, as in: 1. blah blah blah blah some more text here 2. blah blah blah blah some more text here 3. blah blah blah blah some more text here But when I have successive paragraphs of bullets, it comes out like this (and I can't find a way to line it up): � First line of text here Second line of text here � First line of text here Second line of text here � First line of text here Second line of text here Is that just the way things are, or am I missing something? TIA, Craig There is a ...