Adding Edit Control to MainFrame.

I'm trying to add an Edit Control to MainFrame. I'm creating an
instance of CEdit in the paint message like this:

void SAFrame::OnPaint() {
	CFrameWnd::OnPaint();

	CEdit *PEdit = new CEdit;

	PEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP |
WS_BORDER,
	             CRect(10, 50, 150, 70), this, 0x1552);
}

But the control is not displayed. I think you have better ideas.

-- Saint Atique
[Novice MFC Programmer]
0
Saint
4/20/2010 7:00:38 PM
vc.mfc 33608 articles. 0 followers. Follow

18 Replies
2027 Views

Similar Articles

[PageSpeed] 18

"Saint Atique" <unix9n@gmail.com> wrote in message 
news:1db59444-17d4-4bc1-bc7a-1adcf3b75b9b@v8g2000vbh.googlegroups.com...
> I'm trying to add an Edit Control to MainFrame. I'm creating an
> instance of CEdit in the paint message like this:
>
> void SAFrame::OnPaint() {
> CFrameWnd::OnPaint();
>
> CEdit *PEdit = new CEdit;
>
> PEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP |
> WS_BORDER,
>              CRect(10, 50, 150, 70), this, 0x1552);
> }
>
> But the control is not displayed. I think you have better ideas.
>

Don't call CFrameWnd::OnPaint() from within SAFrame::OnPaint().  It is not 
necessary and causes an error because EndPaint() is called before you have a 
chance to paint.

Move the code to create the edit control into SAFrame::OnCreate() which is 
called once, not every time the window is painted.

Rename PEdit to m_edit and make it a member of SAFrame.  (Not a pointer, but 
a CEdit instance).  Child windows like this are meant to have member 
instances and not pointers (due to the way the object is destroyed).

-- David 

0
David
4/20/2010 7:08:06 PM
> "Saint Atique" <unix9n@gmail.com> wrote in message 
> news:1db59444-17d4-4bc1-bc7a-1adcf3b75b9b@v8g2000vbh.googlegroups.com...
>> I'm trying to add an Edit Control to MainFrame. I'm creating an
>> instance of CEdit in the paint message like this:
>>
>> void SAFrame::OnPaint() {
>> CFrameWnd::OnPaint();
>>
>> CEdit *PEdit = new CEdit;
>>
>> PEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP |
>> WS_BORDER,
>>              CRect(10, 50, 150, 70), this, 0x1552);
>> }
>>
>> But the control is not displayed. I think you have better ideas.


I agree with David Ching's comments.  In addition, if this is a 
document/view app you will not see the edit control because the client area 
of the CMainframe is always hidden behind the view window(s).  What are you 
trying to accomplish, and have you considered using a CFormView for the 
control(s)?

-- 
Scott McPhillips [VC++ MVP] 

0
Scott
4/20/2010 8:07:38 PM
This is without a doubt some of the worst code I have seen!

If you want to add a control to a main frame, you should add it at the point where the
main frame is created!  OnInitInstance.  Doing anything in OnPaint EXCEPT painting is
stupid.

Actually, if you are doing an SDI app, create a CEditView instead; this is the correct
approach.  B ut NEVER, EVER do something this bad!

Alternatively, have you considered a CFormView for your app, where you place the controls
on a dialog template?

Note that EVERY time the window is painted, a NEW edit control is created!  

I don't even know where you got those completely random numbers like 10 and 50 and 150 and
70.  Did you roll dice?  Or did you want to create an app that only works on your machine
this week, with your current video card, your current display driver, your current display
screen, your current display resolution, your current default font, and for all I know,
for the current angular position between Jupiter and Mars.  If you want to create a
control, it MUST be based upon computations that are done relative to the font size in the
control (I note you do not select a font for the control, which means you get the ugly
default system font!), and other values derived from the current display settings and font
information (see ::GetSystemMetrics, ::GetTextMetrics, and quite possibly CWnd::GetFont,
CWnd::SetFont, GetStockObject, etc.)  As soon as you hardwire a number like this into a
graphics routine, you can be dead certain you have a fundamental design defect.

Here';s a simple rule: if your OnPaint handler does ANYTHING other than GDI commands to
draw, or computations of parameters to GDI calls to draw, then you have made a terrible,
terrible mistake in your design, and you must rewrite the code so there is no longer
anything done in the OnPaint handler EXCEPT graphics drawing operations.

This is an example of an absolutely unacceptable practice.
					joe

On Tue, 20 Apr 2010 12:00:38 -0700 (PDT), Saint Atique <unix9n@gmail.com> wrote:

>I'm trying to add an Edit Control to MainFrame. I'm creating an
>instance of CEdit in the paint message like this:
>
>void SAFrame::OnPaint() {
>	CFrameWnd::OnPaint();
>
>	CEdit *PEdit = new CEdit;
>
>	PEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP |
>WS_BORDER,
>	             CRect(10, 50, 150, 70), this, 0x1552);
>}
>
>But the control is not displayed. I think you have better ideas.
>
>-- Saint Atique
>[Novice MFC Programmer]
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
4/21/2010 1:32:07 AM
Hello,

David Ching wrote:
> Rename PEdit to m_edit and make it a member of SAFrame.  (Not a pointer, 
> but a CEdit instance).  Child windows like this are meant to have member 
> instances and not pointers (due to the way the object is destroyed).

Could you explain this a bit more in detail please? What would be the 
problem if I make it

CEdit* m_edit;

allocate it inside OnCreate
m_edit = new .... // and so on

and then deallocate it inside the destructor like
if(m_edit)
   delete m_edit


I would be interested especially in windows API/MFC implications of 
doing this not any strictly C++ ones (like use 
std::auto_ptr/std::unique_ptr).

Best regards,

Oliver
0
Oliver
4/21/2010 1:26:12 PM
"Oliver Regenfelder" <oliver.regenfelder@gmx.at> wrote in message 
news:91017$4bcefd03$54772cd9$13933@news.inode.at...
> Hello,
>
> David Ching wrote:
>> Rename PEdit to m_edit and make it a member of SAFrame.  (Not a pointer, 
>> but a CEdit instance).  Child windows like this are meant to have member 
>> instances and not pointers (due to the way the object is destroyed).
>
> Could you explain this a bit more in detail please? What would be the 
> problem if I make it
>
> CEdit* m_edit;
>

Google for "CWnd m_bAutoDelete".  It has to do with whether MFC performs a 
"delete this" while handling WM_NCDESTROY.  For CFrameWnd derived classes, 
it does, therefore, it is expected your CFrameWnd derived class is allocated 
on the heap (e.g. "new SAFrame").  But it does not with CWnd derived classes 
like CEdit.  Therefore it is expected your CEdit is allocated on the stack 
(e.g. as a member variable of SAFrame).

-- David
 

0
David
4/21/2010 2:42:42 PM
It is not at all clear why a 'new' is required; this is generally the mark of a beginner.

Just declare a varriable
	CEdit m_edit;
in the class of the window that is supposed to be the parent of the edit control, and
simpy do
	m_edit.Create(...);

The 'new' operator is overused in such contexts.  It is almost never needed to create an
instance of a CWnd-derived class (modeless dialog boxes are one of the very few and rare
exceptions to this)
				joe

On Wed, 21 Apr 2010 15:26:12 +0200, Oliver Regenfelder <oliver.regenfelder@gmx.at> wrote:

>Hello,
>
>David Ching wrote:
>> Rename PEdit to m_edit and make it a member of SAFrame.  (Not a pointer, 
>> but a CEdit instance).  Child windows like this are meant to have member 
>> instances and not pointers (due to the way the object is destroyed).
>
>Could you explain this a bit more in detail please? What would be the 
>problem if I make it
>
>CEdit* m_edit;
>
>allocate it inside OnCreate
>m_edit = new .... // and so on
>
>and then deallocate it inside the destructor like
>if(m_edit)
>   delete m_edit
>
>
>I would be interested especially in windows API/MFC implications of 
>doing this not any strictly C++ ones (like use 
>std::auto_ptr/std::unique_ptr).
>
>Best regards,
>
>Oliver
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
4/21/2010 2:59:33 PM
Hello,

Joseph M. Newcomer wrote:
> It is not at all clear why a 'new' is required; this is generally the mark of a beginner.

I didn't say that a new is required, I know that I can do things on the
stack and be saved from some problems already C++ wise.
The intend of my question was to figure out why the new is a bad Idea in
terms of MFC/Win API interaction. Partly because I have to deal with
code who does such things, and partly to enrich my understanding of the
underlying technology.

Best regards,

Oliver
0
Oliver
4/21/2010 4:36:53 PM
No, you can't do it on the stack.  If you do, when the variable goes out of scope, the
window disappears (not for a pointer on the stack, which puts the object on the heap).

THere is no reason to go around creating objects dynamically if you can create them
without 'new'.  You want the objects to be self-destructing when the containing object is
deleted.  Every time you create a 'new' object on the heap, you create an opportunity for
a storage leak.
				joe

On Wed, 21 Apr 2010 18:36:53 +0200, Oliver Regenfelder <oliver.regenfelder@gmx.at> wrote:

>Hello,
>
>Joseph M. Newcomer wrote:
>> It is not at all clear why a 'new' is required; this is generally the mark of a beginner.
>
>I didn't say that a new is required, I know that I can do things on the
>stack and be saved from some problems already C++ wise.
>The intend of my question was to figure out why the new is a bad Idea in
>terms of MFC/Win API interaction. Partly because I have to deal with
>code who does such things, and partly to enrich my understanding of the
>underlying technology.
>
>Best regards,
>
>Oliver
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
4/21/2010 4:41:42 PM
Hello,

Joseph M. Newcomer wrote:
> No, you can't do it on the stack.

Sorry for the wrong formulation. I actually ment non pointer member 
variable instead of a stack variable.

> THere is no reason to go around creating objects dynamically if you can create them
> without 'new'.  You want the objects to be self-destructing when the containing object is
> deleted.  Every time you create a 'new' object on the heap, you create an opportunity for
> a storage leak.

I know, that is why I mentioned that 'besides C++ problem' stuff. What I
am interested in are special windows/MFC problems which might occure if
,lets say, I do use a member pointer variable for a control like CEdite*
allocate with new in the constructor and deallocate with delete in the
destructor of the window containing the CEdit. I know that this is not
a good Idea - I just want to know whether this also triggers some
strange Windows Problems (as David Ching already suggested). I did
some googling about this CWnd m_bAutoDelete but couldn't find any
truly helpful stuff.

Best regards,

Oliver
0
Oliver
4/21/2010 6:51:07 PM
See below...
On Wed, 21 Apr 2010 20:51:07 +0200, Oliver Regenfelder <oliver.regenfelder@gmx.at> wrote:

>Hello,
>
>Joseph M. Newcomer wrote:
>> No, you can't do it on the stack.
>
>Sorry for the wrong formulation. I actually ment non pointer member 
>variable instead of a stack variable.
****
I use non-pointer member variables all the time for this and have never had a problem.
****
>
>> THere is no reason to go around creating objects dynamically if you can create them
>> without 'new'.  You want the objects to be self-destructing when the containing object is
>> deleted.  Every time you create a 'new' object on the heap, you create an opportunity for
>> a storage leak.
>
>I know, that is why I mentioned that 'besides C++ problem' stuff. What I
>am interested in are special windows/MFC problems which might occure if
>,lets say, I do use a member pointer variable for a control like CEdite*
>allocate with new in the constructor and deallocate with delete in the
>destructor of the window containing the CEdit. I know that this is not
****
It is a common mistake to put code like this into constructors or destructors.  These are
precisely the WRONG place to put code like this!  You must not create windows in the
constructor because the parent window does not exist, and you must not do the delete in
the destructor because the parent has already been destroyed, taking the child window with
it.

If you do use the pointer technique, which I consider poor practice, you must do a
DestroyWindow on the control in the OnDestroy handler of the parent window, and in the
PostNcDestroy handler of the control should say
	delete this

but this is poor practice to use dynamic allocation without any good reason.
****
>a good Idea - I just want to know whether this also triggers some
>strange Windows Problems (as David Ching already suggested). I did
>some googling about this CWnd m_bAutoDelete but couldn't find any
>truly helpful stuff.
****
If you just declare a non-pointer variable you don't have ANY of these problems!  Better
still, you place the control at design time, especially for a CEdit.
				joe
****
>
>Best regards,
>
>Oliver
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
4/22/2010 4:11:36 AM
You people are genius. I wonder how had you been?

Can you recommend me a book that will teach me these simple but
interesting things?
0
Saint
4/22/2010 4:53:35 AM
"Saint Atique" <unix9n@gmail.com> wrote in message 
news:9afd1444-ac44-4156-afd3-76c39fb8106c@y14g2000yqm.googlegroups.com...
> You people are genius. I wonder how had you been?
>
> Can you recommend me a book that will teach me these simple but
> interesting things?

Ivor Horton's "Beginning Visual C++ 2010"

He also has versions for 2005 and 2008.

-- David 

0
David
4/22/2010 2:41:57 PM
Hello,

Joseph M. Newcomer wrote:
> ****
> I use non-pointer member variables all the time for this and have never had a problem.

Me too. The question was more out of interest and for deeper
understanding which I should have pointed out more clearly.

> It is a common mistake to put code like this into constructors or destructors.  These are
> precisely the WRONG place to put code like this!  You must not create windows in the
> constructor because the parent window does not exist, and you must not do the delete in
> the destructor because the parent has already been destroyed, taking the child window with
> it.
> 
> If you do use the pointer technique, which I consider poor practice, you must do a
> DestroyWindow on the control in the OnDestroy handler of the parent window, and in the
> PostNcDestroy handler of the control should say
> 	delete this

Thanks for the explanation.

> If you just declare a non-pointer variable you don't have ANY of these problems!  Better
> still, you place the control at design time, especially for a CEdit.

I normaly place them inside the Dialog editor (or edit the .rc) file and 
generate the necessary control/value variables. Then mostly one day 
later I figure I have accidentaly made them public and then change them 
to protected (worst default settings ever...).

Best regards,

Oliver
0
Oliver
4/23/2010 7:33:02 AM
See below...
On Fri, 23 Apr 2010 09:33:02 +0200, Oliver Regenfelder <oliver.regenfelder@gmx.at> wrote:

>Hello,
>
>Joseph M. Newcomer wrote:
>> ****
>> I use non-pointer member variables all the time for this and have never had a problem.
>
>Me too. The question was more out of interest and for deeper
>understanding which I should have pointed out more clearly.
>
>> It is a common mistake to put code like this into constructors or destructors.  These are
>> precisely the WRONG place to put code like this!  You must not create windows in the
>> constructor because the parent window does not exist, and you must not do the delete in
>> the destructor because the parent has already been destroyed, taking the child window with
>> it.
>> 
>> If you do use the pointer technique, which I consider poor practice, you must do a
>> DestroyWindow on the control in the OnDestroy handler of the parent window, and in the
>> PostNcDestroy handler of the control should say
>> 	delete this
>
>Thanks for the explanation.
>
>> If you just declare a non-pointer variable you don't have ANY of these problems!  Better
>> still, you place the control at design time, especially for a CEdit.
>
>I normaly place them inside the Dialog editor (or edit the .rc) file and 
>generate the necessary control/value variables. Then mostly one day 
>later I figure I have accidentaly made them public and then change them 
>to protected (worst default settings ever...).
***
In the entire history of MFC, all the way back to Win16 versions, there has NEVER been a
sensible reason to EVER make a control variable or an event handler 'public'.  But the
poor design and implementation of the ClassWizard parser required that all this stuff be
together.  Instead of excercising any form of intelligent design (we know software must
'evolve' because we see no trace of intelligent design) when the new parser was written,
Microsoft chose to leave these as 'public', which is simply stupid.  I hand-edit my .h
files to make EVERYTHING which does not NEED to be 'public' be 'protected' (sadly,  some
beginners confuse 'protected' with 'private' and make everything 'private', which is just
about as stupid, since you will not be able to derive a subclass from this.)

The default is a horrible choice, and the randomization of the .h file (things appear in
the order they are added, instead of being grouped intelligently) is another horrible
choice.

But that's why we have text editors.

"Parameterization is how we deal with anticipated change.  The way we deal with
unanticipated change is a text editor" -- Brian Kernighan
				joe
****
>
>Best regards,
>
>Oliver
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
4/24/2010 1:57:49 AM
Hello,

Joseph M. Newcomer wrote:
> The default is a horrible choice, and the randomization of the .h file (things appear in
> the order they are added, instead of being grouped intelligently) is another horrible
> choice.

I think this randomization didn't happen with the older versions, as
they used those special AFX_DATA, AFX_INIT sections.

Best regards,

Oliver
0
Oliver
4/24/2010 6:26:07 AM
On Apr 22, 8:41=A0pm, "David Ching" <d...@remove-this.dcsoft.com> wrote:
> Ivor Horton's "Beginning Visual C++ 2010"
>
> He also has versions for 2005 and 2008.
>
> -- David

Any other book that explains the internal coding part well?
0
Saint
4/25/2010 11:06:07 AM
Take a look at my MVP Tips site.  There's some introductory material and advanced material
there.

I wanted to publish it as a book, but my publisher and my agent both said "MFC is dead
technology".
				joe

On Wed, 21 Apr 2010 21:53:35 -0700 (PDT), Saint Atique <unix9n@gmail.com> wrote:

>You people are genius. I wonder how had you been?
>
>Can you recommend me a book that will teach me these simple but
>interesting things?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
4/25/2010 6:38:23 PM
"Saint Atique" <unix9n@gmail.com> wrote in message 
news:38c96143-1874-405f-92c1-b1cb0dc1f0f3@y6g2000prk.googlegroups.com...
> Any other book that explains the internal coding part well?

No new MFC Internals book has been published for decades.  Good old ones are 
by authors:  Prosisse and Blaszczak.

-- David 

0
David
4/26/2010 1:15:00 AM
Reply:

Similar Artilces:

Adding Backup and Security Status to Windwos SBS Console
Backup Status; It is possible to add the same Backup Status notification to a second server? Or maybe a client machine that you are using Windows based backup? Security Status; I would assume that I need to enable the firewall rule for the severs to have the the Security Status change from "Not Available" to OK correct? Or is there a fix for this? I tried to search for threads and couldn't find anything. Kev wrote: > Backup Status; > It is possible to add the same Backup Status notification to a second > server? Or maybe a client ma...

Does exchange control reminders in Outlook?
Greetings. Our network uses Exchange 2003 on a Windows 2000 Server server to administer the company e-mail. We used to use PST files in Outlook 97 to manage the e-mail for users but now we use Outlook 97 and Exchange Mailboxes. One of my users is noting that reminders in Outlook 97 notify him when they're suppose to for all events, but some things he postpones for many weeks for various reasons. Some items have since quit reminding him, even though they are still in his calendar. He has done this for years, and though he probably should change this practice of his, he recalls that rem...

How do I edit the subject line of emails that I've received?
I used to be able to edit the subject line of my received emails that are in my Inbox. Some people do not know how to compose a helpful subject line. :) Somehow I hit the wrong key or the wrong button, and now my ability to edit is gone. I can't figure out how to do it again, and I can't find it in Help topics. I might not be searching for the correct phrase, though. Any help would be SO appreciated. Thanks! Reply to the email, change the Subject line and then close it, saving the changes. "e11en" <e11en@discussions.microsoft.com> wrote in me...

Update only the added invitees
I recently started using Outlook 2007. I added an invitee to a meeting and wanted only them to get the invite versus the whole group. I checked the send to only the added invitees button. What went wrong. Is there a save and close option like 2003? ...

visible controls
Visible controls In my form the code for making controls visible and invisible does not work. My code is the following: Private Sub Form_Current() If Me![supplierid] = 1 Then Me.RaufGrade.Visible = False Me.RaufCode.Visible = False Me.AralGrade.Visible = True Me.AralCode.Visible = True ElseIf Me![supplierid] = 2 Then Me.AralGrade.Visible = False Me.AralCode.Visible = False Me.RaufGrade.Visible = True Me.RaufCode.Visible = True End If End Sub Why is it so? Is it because the form is continous? How can I make it work? -- Message posted via AccessMonster.com http://www.ac...

ODBC ms Query will not edit saved query
Hello, I am using Excel to query an Oracle database. When using Excel 97 and Windows95/98 all saved queries worked fine. After upgrading to Windows2000 and Excel 2000 queries will refresh data, but we cannot edit the queries. When we choose "get external data / edit query" MSQuery appears to flash on the screen for a split second and then vanish. I have created system DSNs as instructed by Microsoft Knowledge Base Article - 322046, but it did not correct the problem. Any suggestions would be greatly appreciated. THANKS, David ...

Adding SOP number to POP blank form
I'd like to know how to add the SOP number to the POP form in GP 8.0. I realize in the earlier version you were able to configure the SOP_POPLink table relationships to POP_PO however I can't seem to configure this in 8.0. Is there a new report writer function? Thanks, ...

Adding row to a table
I have appreciated the input of g. mayor and have found his "An alternative method of adding a row to a protected table" (http://www.gmayor.com/word_vba_examples.htm) to be quite helpful. It is designed to be an 'exit macro' and I am trying to use it in a slightly different way. My issue is that as a user tabs through a form they will always come to the last cell and tabbing to the next formfield just creates another row. So I am attempting to set up a button (commandbutton) that will run the macro and add an additional row 'on demand.' I have this...

ActiveX control and design mode
Hi, is it possible for an activex control to tell the container to invoke the controls design mode? I'm developing an activex control to be used in office, and I would like the control to start in design mode when inserted into powerpoint for instance. Regards Johan ...

publisher, wrong edition?
im trying to open a file i made in publisher at college but when i try and open it at home off my pen drive its saying i can open the file from another version, is there anything i can do? At college, save the file in the version of Publisher you have at home. -- Don Vancouver, USA "jessica" <jessica@discussions.microsoft.com> wrote in message news:7222AD16-3FE4-447C-B239-FB4A48E1DF1A@microsoft.com... > im trying to open a file i made in publisher at college but when i try and > open it at home off my pen drive its saying i can open the file from > another &g...

Can't open a Publisher 2K file in Publisher 2002, edit text only .
Why can't I open an existing Publisher 2000 file with Publisher 2002, then make minor text edits and re-save the file in Publisher 2000 without getting the error message, "There is a picture on page 1 that is too large to be converted to previous versions of Publisher." Publisher 2000 did not use compression... PUB2000: File Size Increases Unexpectedly When You Insert Picture http://support.microsoft.com/default.aspx?scid=kb;en-us;253973 -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Art Frustrated with Publisher...

TILE can help you to edit RMS or POS 2009 items in seconds
TILE can make the task of record editing and updating extremely easy. With TILE, you will simply open your RMS records in a grid-like view (as we have in MS-Excel), quickly apply one or more filters, use your mouse to select the records, right-click, enter the desired value and update. All 100 records will be updated in a flash! For details, visit: http://www.24sevencart.com/tile.htm On Apr 22, 4:55=A0pm, Mark Antonio <antonio.mark...@gmail.com> wrote: > TILE can make the task of record editing and updating extremely easy. > With TILE, you will simply open your RMS recor...

Disabling / graying out a control at runtime
Hi, I have a control on a modal dialog, that I which to disable when the user does something. How do I do this? EnableWindow(FALSE); -- Regards, Nish [VC++ MVP] http://www.voidnish.com http://blog.voidnish.com "Hamish" <h.dean@xtra.co.nz> wrote in message news:1A25e.16609$1S4.1692401@news.xtra.co.nz... > Hi, I have a control on a modal dialog, that I which to disable when the > user does something. How do I do this? > > look for [EnableWindow] api -- With Regards Alok Gupta Visit me at http://alok.bizhat.com "I Believe ...

Custom Context Menu for Edit Control
Hello all .. I have a control bar class, CTextBar, derived from the child of CControlBar which uses an edit control (CTextEdit derived from CEdit). And i want to create a custom context menu for the edit control with Copy, Selectall and Wordwrap. My wordwrap implementation is kind of not perfect and i feel it could be done better. However, currently i use something like destroying the edit control and recreating it with the right flags set to make the wordwrap effect, as in a notepad. This implementation has a disadvantage because it needs a pointer to its parent window (in this case, the CCo...

Adding Child Support as an expense
I've found out that Money 2004 has "Child Support Received" listed as an available income, but I am unable to find something like "Child Support Paid" in the expenses. The closest I've found, is Child Care. Does anyone have any "How-To" or "Where It Is" advice for this? You can always create your own expense account. I'd probably create a whole new category just as you suggest "Child Support Paid." "Rick" <rickgibson@tampabay.rr.com> wrote in message news:1edd101c456b9$9cd7bfa0$a101280a@phx.gbl... > I'...

Can't "edit" underlined value in Rules Wizard screen
Running Outlook 2002. I go to Tools, Rules Wizard, and highlight an email filter called Junk Email. The filter works well, no problem. However, I want to delete some email addresses from that particular filter. The instructions over the lower half of that display say "click on an underlined value to edit it." However, clicking on the "Junk Senders" value does not open it. What do you think is wrong? All the other values in all the other filters in Rules Wizard will open and allow me to edit them. Marc ...

Money 2001 Small Business Edition (UK)
Hi, I have lost my Money 2001 CD which I got with my Dell laptop back in 2001, and have been running fine ever since. I installed some software which is now forcing Money to reinstall itself, and I cannot find my CD. So I need to upgrade (which is fine), but which version support the old 2001 Small Business edition? Many thanks, Hi I managed to find out that the version is Personal and Business, not Small Business. Can anyone offer some advice as to which versions are compatible with which? I simply need to access my personal account transactions as the business side was never us...

domain controllers do not appear to be running #2
Hi There are a number of errors when running CRM 3.0 and I have the following error when I run the environment diagnostics check : "Some of the domain controllers do not appear to be running. The following list of servers should be checked. PrivUserGroup {8654dfe6-2d69-4ead-8f86-d49f26814c64} ReportingGroup {8654dfe6-2d69-4ead-8f86-d49f26814c64} SQLAccessGroup {8654dfe6-2d69-4ead-8f86-d49f26814c64} UserGroup {8654dfe6-2d69-4ead-8f86-d49f26814c64} " Does anyone have any suggestions ? If I re-run the setup do I risk losing any data/configuration setting on my current installatio...

i have #name? at my control
i have #name? at my control. I cobined these functions (iif(), left(), right(),count() ,integer() and the concatenation sign(&)) to change numbers into texts on a form . It woked well as i wanted . after a perioud of using my system perfictly I faced this problem. i began trubleshooting to determine the cause . the cases noted by "help" missed the problem .i removed the ms_office and reset it up and checked the refernces and unchecked the microsft missing refernces. but the problem still faceing me . i copied my system in another computer is worked well. them i formated m...

Editing an Automatically Sent Message
We have a user that setup a message to automatically be send each Monday. They now wish to edit that message, problem is, I cannot seem to find it. It doesn't even show up in her sent items. I am sure it is an easy fix, but it has alluded me. Any help would be greatly appreciated. Thanks Mark Winning Systems Administrator Martin Memorial Health Systems ...

Re: property page with COM control inside .dll does not work!
Hi, Alexander sorry I made a mistake, I meen "make the property page a COM control". But this seems too hard for me. Now I am trying to put the dialog resource in a dll and load it to CMyPropertyPage later in another application. I have made the dll with success but this property page cannot be shown in the property sheet just like before. My code seems like this: the dll is named TeRes.dll, and in another application: CPropertyPage* makePropertyPage(bool flag) { CPropertyPage* p; if(flag) { HINSTANCE hDll =3D LoadLibrary("TeRes.dll"); if(hDll...

Newbie Question Column Adding Please Help
I have a spreadsheet that has a column and the contents of the column is either a "Y" or "N" I would like to know how to count (sum) the number of "Y"'s and "N"s to give me the total number of "Y"s and the total number of "N"'s Column A Y Y Y Y N N N N N Total Y 4 Total N 5 Thanks Tom =countif(A:A,"n") =countif(a:a,"y") Tom Grassi wrote: > > I have a spreadsheet that has a column and the contents of the column is > either a "Y" or "N" I would like to know how t...

multi-threaded control not destroyed on exiting the page?
I have created an ActiveX control (subclassing COleControl) which uses the afxRegFreeThreading model, and I have a small sample web page which inserts the control using an <object> tag. I noticed that when my page places the control inside the <head> tag, the control's destructor is called when my browser goes to a different page. But if the control is inside the <body> tag, the destructor is not called when I leave the page. The control's destructor is eventually called when I exit my browser, but I fear that my control is continuing to occupy system resources unt...

how do i make a check box control other check boxes?
I have a form that has 5 check boxes. I'd like to have an additional check box that would check all of the other check boxes. Suggestions? Thanks In the AfterUpdate event of the 6th check box, put code: Private Sub Checkbox6_AfterUpdate Me.Checkbox1 = True Me.Checkbox2 = True Me.Checkbox3 = True Me.Checkbox4 = True Me.Checkbox5 = True End Sub Or, if you want all 5 unchecked when checkbox 6 is unchecked, Private Sub Checkbox6_AfterUpdate Me.Checkbox1 = Me.Checkbox6 Me.Checkbox2 = Me.Checkbox6 Me.Checkbox3 = Me.Checkbox6 Me.Checkbox4 = Me.Checkbox6 Me.Checkbox5 =...

Excel OCX/ActiveX Visual Controls for creating a Excel Dashboard/Scorecard
Hello All I want to create a Excel dashboard and I would like to use some ActiveX/OCX controls like a gauge, dial, slider and stereo bars,etc to display data visually in Excel. Can you please share if you know of some sites where we can get a free download of these controls or we can get a trial version we can evaluate and buy them. Also, if possible your experiences with these kind of visual ActiveX/OCX controls. Thanks Belinda Belinda Funnily enough I've been playing around with some ActiveX controls today which sound like the sort you're after. I've got Ahead Nero Burning...