Calling parent's function

Dear all,

i have a typical situation in my project, where several parent windows
use a derived edit control (CTextEdit). I wanted to use a mechanism
where i can call a parent function from the edit control, CTextEdit,
which (function) is common to all the parents yet perform different
operations. Therefore the appropriate function is executed at runtime.
Can any of you provide an idea to acheive this ?? I am contemplating
using RTTI, but have no idea how does it fit in this scenario.

thanks for you time

0
prakash437 (47)
6/27/2006 10:25:25 AM
vc.mfc 33608 articles. 0 followers. Follow

14 Replies
754 Views

Similar Articles

[PageSpeed] 16

"PSN" <prakash437@gmail.com> wrote in message
news:1151403925.178623.307070@p79g2000cwp.googlegroups.com...
> Dear all,
>
> i have a typical situation in my project, where several parent windows
> use a derived edit control (CTextEdit). I wanted to use a mechanism
> where i can call a parent function from the edit control, CTextEdit,
> which (function) is common to all the parents yet perform different
> operations. Therefore the appropriate function is executed at runtime.
> Can any of you provide an idea to acheive this ?? I am contemplating
> using RTTI, but have no idea how does it fit in this scenario.
>


There are few ways you can do this.

1. Use SendMessage/PostMessage to send a custom message to parent window:

ASSERT_VALID(GetParent());
GetParent()->PostMessage(UWM_SOME_MESSAGE);

Here your parent window object will handle this message and do whatever it
wants.

2. Have a common base class for all your parent objects. Use casting and
GetParent to get to it from the control and then call some known function.
Here your control will need to know about your parent class.

3. Pass the parent object to control in constructor or some other way.
Control can then call methods on it whenever it wants.

4. Have your parent classes support some known interface. Controls can query
about the interface after calling GetParent and call a known method of the
interface.

5. Use some Subject/Observer mechanism. Make your control the subject and
parent as the observer. Fire events from control when you want the observers
to handle these.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


0
ajaykalra (6842)
6/27/2006 10:48:36 AM
Thanks a lot .. The 1st and 2nd proposals were really helpful ..
however, i have no idea abt the 3,4 and 5 methods .. any documentation
that you would like to point ..

thanks again,

Ajay Kalra wrote:
> "PSN" <prakash437@gmail.com> wrote in message
> news:1151403925.178623.307070@p79g2000cwp.googlegroups.com...
> > Dear all,
> >
> > i have a typical situation in my project, where several parent windows
> > use a derived edit control (CTextEdit). I wanted to use a mechanism
> > where i can call a parent function from the edit control, CTextEdit,
> > which (function) is common to all the parents yet perform different
> > operations. Therefore the appropriate function is executed at runtime.
> > Can any of you provide an idea to acheive this ?? I am contemplating
> > using RTTI, but have no idea how does it fit in this scenario.
> >
>
>
> There are few ways you can do this.
>
> 1. Use SendMessage/PostMessage to send a custom message to parent window:
>
> ASSERT_VALID(GetParent());
> GetParent()->PostMessage(UWM_SOME_MESSAGE);
>
> Here your parent window object will handle this message and do whatever it
> wants.
>
> 2. Have a common base class for all your parent objects. Use casting and
> GetParent to get to it from the control and then call some known function.
> Here your control will need to know about your parent class.
>
> 3. Pass the parent object to control in constructor or some other way.
> Control can then call methods on it whenever it wants.
>
> 4. Have your parent classes support some known interface. Controls can query
> about the interface after calling GetParent and call a known method of the
> interface.
>
> 5. Use some Subject/Observer mechanism. Make your control the subject and
> parent as the observer. Fire events from control when you want the observers
> to handle these.
> 
> --
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com

0
prakash437 (47)
6/27/2006 12:48:10 PM
Define what you mean by "parent".  Do you mean "superclass" or do you really mean
"parent", as in "parent window".  If the latter, the concept is meaningless; you CANNOT
call member functions in the parent in a well-written program, because the edit control
cannot possibly know what its parent is.  If you need to notify the parent about
something, use
	GetParent()->SendMessage(UWM_YOUR_MESSAGE_HERE, ...);
and preferrably use a Registered Window Message to handle this.  See my essay on Message
Management on my MVP Tips site.  RTTI doesn't even enter the discussion.
				joe

On 27 Jun 2006 03:25:25 -0700, "PSN" <prakash437@gmail.com> wrote:

>Dear all,
>
>i have a typical situation in my project, where several parent windows
>use a derived edit control (CTextEdit). I wanted to use a mechanism
>where i can call a parent function from the edit control, CTextEdit,
>which (function) is common to all the parents yet perform different
>operations. Therefore the appropriate function is executed at runtime.
>Can any of you provide an idea to acheive this ?? I am contemplating
>using RTTI, but have no idea how does it fit in this scenario.
>
>thanks for you time
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
6/29/2006 5:08:56 PM
Joseph M. Newcomer wrote:
> Define what you mean by "parent".  Do you mean "superclass" or do you really mean
> "parent", as in "parent window".  If the latter, the concept is meaningless; you

I meant parent Window.

> call member functions in the parent in a well-written program, because the edit control
> cannot possibly know what its parent is.

By RTTI, i meant, Identifying the type at Runtime, although using,
RUNTIME_CLASS. I am able to identify the parent class and call its
public member functions, without any problem. Do you think this is not
a good programming practice ??

> If you need to notify the parent about something, use
> 	GetParent()->SendMessage(UWM_YOUR_MESSAGE_HERE, ...);
> and preferrably use a Registered Window Message to handle this.  See my essay on Message
> Management on my MVP Tips site.  RTTI doesn't even enter the discussion.
> 				joe
>
> On 27 Jun 2006 03:25:25 -0700, "PSN" <prakash437@gmail.com> wrote:
>
> >Dear all,
> >
> >i have a typical situation in my project, where several parent windows
> >use a derived edit control (CTextEdit). I wanted to use a mechanism
> >where i can call a parent function from the edit control, CTextEdit,
> >which (function) is common to all the parents yet perform different
> >operations. Therefore the appropriate function is executed at runtime.
> >Can any of you provide an idea to acheive this ?? I am contemplating
> >using RTTI, but have no idea how does it fit in this scenario.
> >
> >thanks for you time
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm

0
prakash437 (47)
6/30/2006 3:21:32 PM
PSN wrote:
>>Define what you mean by "parent".  Do you mean "superclass" or do you really mean
>>"parent", as in "parent window".  If the latter, the concept is meaningless; you
> 
> 
> I meant parent Window.
> 
> 
>>call member functions in the parent in a well-written program, because the edit control
>>cannot possibly know what its parent is.
> 
> 
> By RTTI, i meant, Identifying the type at Runtime, although using,
> RUNTIME_CLASS. I am able to identify the parent class and call its
> public member functions, without any problem. Do you think this is not
> a good programming practice ??

It is not a good programming practice.  The edit control should be 
independent of parent windows and have no build-time dependencies on 
them.  Use

   GetParent()->SendMessage(...)

which is the way that all the built in controls communicate with their 
parent windows.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
6/30/2006 3:41:30 PM
See below...
On 30 Jun 2006 08:21:32 -0700, "PSN" <prakash437@gmail.com> wrote:

>Joseph M. Newcomer wrote:
>> Define what you mean by "parent".  Do you mean "superclass" or do you really mean
>> "parent", as in "parent window".  If the latter, the concept is meaningless; you
>
>I meant parent Window.
>
>> call member functions in the parent in a well-written program, because the edit control
>> cannot possibly know what its parent is.
>
>By RTTI, i meant, Identifying the type at Runtime, although using,
>RUNTIME_CLASS. I am able to identify the parent class and call its
>public member functions, without any problem. Do you think this is not
>a good programming practice ??
*****
You should not need to identify the parent class; it is an activity that would be
characteristic of a very-poorly-designed system.  You should not be including a header
file for any class in the compilation of a control class.  Such design is severely
contraindicated and represents a programming style that gets an "F" in a class assignment.
It is very, very, very, very bad style, and you should not even consider anything like
this.  That's why we have SendMessage and use messages; that's the clean interface.

Just because it is possible to get something to compile does not prove that it is a
reasonable, sensible, or acceptable methodology.  Get rid of the concept of calling a
method in the parent.
*****
>
>> If you need to notify the parent about something, use
>> 	GetParent()->SendMessage(UWM_YOUR_MESSAGE_HERE, ...);
>> and preferrably use a Registered Window Message to handle this.  See my essay on Message
>> Management on my MVP Tips site.  RTTI doesn't even enter the discussion.
>> 				joe
>>
>> On 27 Jun 2006 03:25:25 -0700, "PSN" <prakash437@gmail.com> wrote:
>>
>> >Dear all,
>> >
>> >i have a typical situation in my project, where several parent windows
>> >use a derived edit control (CTextEdit). I wanted to use a mechanism
>> >where i can call a parent function from the edit control, CTextEdit,
>> >which (function) is common to all the parents yet perform different
>> >operations. Therefore the appropriate function is executed at runtime.
>> >Can any of you provide an idea to acheive this ?? I am contemplating
>> >using RTTI, but have no idea how does it fit in this scenario.
>> >
>> >thanks for you time
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
6/30/2006 4:20:15 PM
thank you all for your replies ..

How about, lets say, if i have a flag variable (public) defined in the
parent class, and i want to check its value in the child class, before
i do something. Is it OK in this case. I understand that hardcoding the
class of the parent in the child code is a bad practise, but what
choice do i have .. Do i again have to create message handling
functions setting/returning this variable i want, in the parent ..

thakns again

Joseph M. Newcomer wrote:
> See below...
> On 30 Jun 2006 08:21:32 -0700, "PSN" <prakash437@gmail.com> wrote:
>
> >Joseph M. Newcomer wrote:
> >> Define what you mean by "parent".  Do you mean "superclass" or do you really mean
> >> "parent", as in "parent window".  If the latter, the concept is meaningless; you
> >
> >I meant parent Window.
> >
> >> call member functions in the parent in a well-written program, because the edit control
> >> cannot possibly know what its parent is.
> >
> >By RTTI, i meant, Identifying the type at Runtime, although using,
> >RUNTIME_CLASS. I am able to identify the parent class and call its
> >public member functions, without any problem. Do you think this is not
> >a good programming practice ??
> *****
> You should not need to identify the parent class; it is an activity that would be
> characteristic of a very-poorly-designed system.  You should not be including a header
> file for any class in the compilation of a control class.  Such design is severely
> contraindicated and represents a programming style that gets an "F" in a class assignment.
> It is very, very, very, very bad style, and you should not even consider anything like
> this.  That's why we have SendMessage and use messages; that's the clean interface.
>
> Just because it is possible to get something to compile does not prove that it is a
> reasonable, sensible, or acceptable methodology.  Get rid of the concept of calling a
> method in the parent.
> *****
> >
> >> If you need to notify the parent about something, use
> >> 	GetParent()->SendMessage(UWM_YOUR_MESSAGE_HERE, ...);
> >> and preferrably use a Registered Window Message to handle this.  See my essay on Message
> >> Management on my MVP Tips site.  RTTI doesn't even enter the discussion.
> >> 				joe
> >>
> >> On 27 Jun 2006 03:25:25 -0700, "PSN" <prakash437@gmail.com> wrote:
> >>
> >> >Dear all,
> >> >
> >> >i have a typical situation in my project, where several parent windows
> >> >use a derived edit control (CTextEdit). I wanted to use a mechanism
> >> >where i can call a parent function from the edit control, CTextEdit,
> >> >which (function) is common to all the parents yet perform different
> >> >operations. Therefore the appropriate function is executed at runtime.
> >> >Can any of you provide an idea to acheive this ?? I am contemplating
> >> >using RTTI, but have no idea how does it fit in this scenario.
> >> >
> >> >thanks for you time
> >> Joseph M. Newcomer [MVP]
> >> email: newcomer@flounder.com
> >> Web: http://www.flounder.com
> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm

0
prakash437 (47)
7/3/2006 3:32:29 PM
PSN wrote:
> thank you all for your replies ..
> 
> How about, lets say, if i have a flag variable (public) defined in the
> parent class, and i want to check its value in the child class, before
> i do something. Is it OK in this case. I understand that hardcoding the
> class of the parent in the child code is a bad practise, but what
> choice do i have .. Do i again have to create message handling
> functions setting/returning this variable i want, in the parent ..
> 
> thakns again

Consider the built in controls as examples.  They all work with any 
parent window class.  That's good modular design.  A custom control 
should have the same reusability.

Your parent can pass a flag to the child when it creates it, or can send 
a message to the child, or the child can send a message requesting the 
flag value be returned.  There are examples of all three techniques in 
the various built in controls.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
7/4/2006 2:41:16 AM
Unless you think the value might change in the parent class you can always 
set it before popping up the control.  For example, you would have the same 
flag variable in the dialog:

m_cMyEditControl.SetMyFlag(m_bMyFlag);

Then the control can check the flag any time it wants.  If you think the 
flag may change during the execution of the dialog or view class you could, 
as Scott suggests, send a message to the control from the dialog (or simply 
call the control's SetMyFlag() routine again to reset the flag.  The point 
is that the parent is setting the variable in the child (control) rather 
than the child retrieving the value and the child can check its own version 
any time it wants without regard to the parent.

You could even set a sane default in the child so that if the parent doesn't 
set it initially it will do what you want.

Tom

"PSN" <prakash437@gmail.com> wrote in message 
news:1151940748.958501.153320@j8g2000cwa.googlegroups.com...
> thank you all for your replies ..
>
> How about, lets say, if i have a flag variable (public) defined in the
> parent class, and i want to check its value in the child class, before
> i do something. Is it OK in this case. I understand that hardcoding the
> class of the parent in the child code is a bad practise, but what
> choice do i have .. Do i again have to create message handling
> functions setting/returning this variable i want, in the parent ..


0
tserface (3861)
7/4/2006 2:43:35 PM
See below...
On 3 Jul 2006 08:32:29 -0700, "PSN" <prakash437@gmail.com> wrote:

>thank you all for your replies ..
>
>How about, lets say, if i have a flag variable (public) defined in the
>parent class, and i want to check its value in the child class, before
>i do something. Is it OK in this case.
****
Absolutely not!  The child class is not permitted to know ANYTHING about the parent class,
period, non-negotiable.
****
> I understand that hardcoding the
>class of the parent in the child code is a bad practise, but what
>choice do i have 
*****
The obviously correct choices:  

1. Copy the value into a boolean variable of the child dialog before doing the DoModal().
The exported variable of the dialog is part of its defined interface, and since the parent
has to include the child in order to do the DoModal, it is free to set the public members
that are defined as part of the interface.   If th value is changed by the dialog, upon
return from the DoModal(), you copy the value back out from the public variable in the
dialog to the appropriate place where it should be stored.

2  GetParent()->SendMessage(UWM_QUERY_VALUE) and the handler returns the result of the
query.   This would be the only option if the value can change after the DoModal()
launches the child dialog; otherwise, there is no real difference between this and (1). If
you have a modeless dialog and need to change values, then a SendMessage(UWM_SET_VALUE,
(WPARAM)newvalue) would be a correct approach.
****
>.. Do i again have to create message handling
>functions setting/returning this variable i want, in the parent ..
*****
Yes.  This is the only correct solution.  The child cannot be allowed to know anything
about the parent; the messaging becomes part of the interface to the child.

Note that neither of these solutions require the child know anything at all about the
implementation of the parent.  Take as given if a child dialog has to know anything about
the implementation of the parent (dead giveaway is that the parent class header file has
to be included) then the design is wrong.

Note that I *always* delete any attempt that ClassWizard makes to #include the
CWinApp-derived class for the project.  This is so foolish it is hard to believe this
blunder has persisted as long as it has.  I either replace it with #include "resource.h"
or just delete it entirely.  No view class, no document class, and no other class in the
entire project other than the CWinApp implementation file and the CMainFrame file need to
know that the CWinApp-derived class exists!
				joe

*****
>
>thakns again
>
>Joseph M. Newcomer wrote:
>> See below...
>> On 30 Jun 2006 08:21:32 -0700, "PSN" <prakash437@gmail.com> wrote:
>>
>> >Joseph M. Newcomer wrote:
>> >> Define what you mean by "parent".  Do you mean "superclass" or do you really mean
>> >> "parent", as in "parent window".  If the latter, the concept is meaningless; you
>> >
>> >I meant parent Window.
>> >
>> >> call member functions in the parent in a well-written program, because the edit control
>> >> cannot possibly know what its parent is.
>> >
>> >By RTTI, i meant, Identifying the type at Runtime, although using,
>> >RUNTIME_CLASS. I am able to identify the parent class and call its
>> >public member functions, without any problem. Do you think this is not
>> >a good programming practice ??
>> *****
>> You should not need to identify the parent class; it is an activity that would be
>> characteristic of a very-poorly-designed system.  You should not be including a header
>> file for any class in the compilation of a control class.  Such design is severely
>> contraindicated and represents a programming style that gets an "F" in a class assignment.
>> It is very, very, very, very bad style, and you should not even consider anything like
>> this.  That's why we have SendMessage and use messages; that's the clean interface.
>>
>> Just because it is possible to get something to compile does not prove that it is a
>> reasonable, sensible, or acceptable methodology.  Get rid of the concept of calling a
>> method in the parent.
>> *****
>> >
>> >> If you need to notify the parent about something, use
>> >> 	GetParent()->SendMessage(UWM_YOUR_MESSAGE_HERE, ...);
>> >> and preferrably use a Registered Window Message to handle this.  See my essay on Message
>> >> Management on my MVP Tips site.  RTTI doesn't even enter the discussion.
>> >> 				joe
>> >>
>> >> On 27 Jun 2006 03:25:25 -0700, "PSN" <prakash437@gmail.com> wrote:
>> >>
>> >> >Dear all,
>> >> >
>> >> >i have a typical situation in my project, where several parent windows
>> >> >use a derived edit control (CTextEdit). I wanted to use a mechanism
>> >> >where i can call a parent function from the edit control, CTextEdit,
>> >> >which (function) is common to all the parents yet perform different
>> >> >operations. Therefore the appropriate function is executed at runtime.
>> >> >Can any of you provide an idea to acheive this ?? I am contemplating
>> >> >using RTTI, but have no idea how does it fit in this scenario.
>> >> >
>> >> >thanks for you time
>> >> Joseph M. Newcomer [MVP]
>> >> email: newcomer@flounder.com
>> >> Web: http://www.flounder.com
>> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/5/2006 8:58:12 PM
Joseph M. Newcomer wrote:

{ ... }

> 
> Note that I *always* delete any attempt that ClassWizard makes to #include the
> CWinApp-derived class for the project.  This is so foolish it is hard to believe this
> blunder has persisted as long as it has.  I either replace it with #include "resource.h"
> or just delete it entirely.  No view class, no document class, and no other class in the
> entire project other than the CWinApp implementation file and the CMainFrame file need to
> know that the CWinApp-derived class exists!
> 				joe
> 

The fewer the number of includes the more reusable is the code.

Sometimes when I'm lazy and writing new classes etc I just copy-paste includes 
from other files. Then on examination - "hey, I don't need the document or the 
app or whatever" and delete them. This tends to make the code project - 
independent by pushing the classes higher up the hierarchial tree.

Also things like - do I really need CMyView or will CView suffice etc.
0
7/6/2006 7:25:42 PM
> The fewer the number of includes the more reusable is the code.
>
> Sometimes when I'm lazy and writing new classes etc I just copy-paste includes
> from other files. Then on examination - "hey, I don't need the document or the
> app or whatever" and delete them. This tends to make the code project -
> independent by pushing the classes higher up the hierarchial tree.

I prefer using Interfaces instead of classes. It minimizes using
include files altogether. I think thats going to be new paradigm in
..net as it makes it more intuitive to use interfaces. There is a COM
hangover in C++ when you start thinking about Interfaces.

---
Ajay

0
ajaykalra (6842)
7/6/2006 7:42:27 PM
I've found that the wizard seems to be based on some primitive notion of non-OO
programming, by throwing a lot of gratuitous #includes around.  I don't understand why
these ever are put in; they are entirely gratuitous, largely useless, and restrict
portability.  What is apalling is that these mistakes persist all the way through VS.NET
2003.

And did you ever wonder why there isn't an about.cpp/.h pair generated, so we can just
"replug" the About box with something that conforms to Microsoft's specified About box?
Or, for that matter, why they don't generate an About box that meets their own
specifications?  Duh!  Modularity?  What's that?
					joe

On Fri, 07 Jul 2006 05:25:42 +1000, Ian Semmel <isemmelNOJUNK@NOKUNKrocketcomp.com.au>
wrote:

>Joseph M. Newcomer wrote:
>
>{ ... }
>
>> 
>> Note that I *always* delete any attempt that ClassWizard makes to #include the
>> CWinApp-derived class for the project.  This is so foolish it is hard to believe this
>> blunder has persisted as long as it has.  I either replace it with #include "resource.h"
>> or just delete it entirely.  No view class, no document class, and no other class in the
>> entire project other than the CWinApp implementation file and the CMainFrame file need to
>> know that the CWinApp-derived class exists!
>> 				joe
>> 
>
>The fewer the number of includes the more reusable is the code.
>
>Sometimes when I'm lazy and writing new classes etc I just copy-paste includes 
>from other files. Then on examination - "hey, I don't need the document or the 
>app or whatever" and delete them. This tends to make the code project - 
>independent by pushing the classes higher up the hierarchial tree.
>
>Also things like - do I really need CMyView or will CView suffice etc.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/6/2006 9:34:51 PM
I'm not sure the AppWizard has changed a lot, under the covers, since way 
back in the 90's, but it is still a functional way of creating a new 
project.  However, I tend to have to move things around and add my own stuff 
for all new projecct.  It still saves me a lot of time getting started 
though.

Tom

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:ga0ra2dl47svvg39jrq56ppegst14sjlcm@4ax.com...
> I've found that the wizard seems to be based on some primitive notion of 
> non-OO
> programming, by throwing a lot of gratuitous #includes around.  I don't 
> understand why
> these ever are put in; they are entirely gratuitous, largely useless, and 
> restrict
> portability.  What is apalling is that these mistakes persist all the way 
> through VS.NET
> 2003.


0
tserface (3861)
7/6/2006 10:24:55 PM
Reply:

Similar Artilces:

function keys
This is a multi-part message in MIME format. ------=_NextPart_000_00F7_01CA63A4.2F980A00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I recently upgraded to windows 7. I don't know if this is the problem or what but suddenly I can't use my function number keys. does anyone have a fix for this problem?? thanks, bonnie ------=_NextPart_000_00F7_01CA63A4.2F980A00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4....

Should be able to change parent and child relationships
Within National Accounts we have the need to change what parent the child is associated to. We use National Accounts to keep track of which customers have a certain funding source. Often that association changes and we would like to be able to change that without having to set-up a whole new child. ---------------- 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 Micros...

IsIconic function
Hi all, To check whether the window is minimized or not I used function IsIconic. It is OK for almost applications but it has an problem with Excel. In Excel I create two workbooks, each workbook in a separate window. I call IsIconic function and pass the handle of workbook window which is displaying and active to it, the result which this function return is TRUE. This value is wrong because the window is displaying and is active window. Please tell me how to fix this problem. Thanks. I don't have an answer but I can tell you that some more complex software might be doing thing...

An option to reassign parent account only or all sub-accounts
When reassigning Accounts, an additional step needs to be added to allow the user to reassigning the parent Account only or all related sub Accounts. Today, when the parent Account is reassigned, all related recodrs, including all sub-Accounts, are reassigned in error to the new user. This cascading function is currently causing significant issues for our large, multi-location Accounts that have one Account Manager with multiple Account managers owning the sub Accounts. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most vot...

Service Call Module #2
Does anyone know if there is an automated solution to create Equipment records via eConnect or Integration Manager Wennsoft ServiceManagement does that as part of the core product. It is also a far better product. "jav" wrote: > Does anyone know if there is an automated solution to create Equipment > records via eConnect or Integration Manager ...

Missing Graph Functionality
In Office 2003, I used to be able to select the following when formating a data series in a graph: fill effects | shadows This would basically give me shadows on the left/rigt sides, etc. This does not appear to be available in Office 2007. Can I still make this selection? Hi, Are you sure about that selection in 2003. For a column chart the option of a Shadow is available on the Patterns tab. The Fill Effects button displays a dialog with Gradient, Texture, Pattern and Picture. But these are all fill effects and not shadows. Any way in xl2007 you would select the series and then usi...

Domain rename in windows 2008 parent can child
Hi, I have two root domain controller sat.au.local. The first root dc that contains all 5 roles has a CA Authroity installed and configured. I have two child domain controller sf.sat.au.local I have an exchange 2007 which is under sf.sat.au.local and an edge server 2007. I have file server running windows 2008 and two other machine running windows 2003 part of the child domain. How do I perform a Domain renamed in this case? As far as I know there have been no major changes when moving from 2003 to 2008. So I would follow the step by step instructions (Trial ...

Public folders: query regarding the "synchronize now" function
Exchange 2003 SP2 I have a query regarding the "synchronize now" function for public folders. Say I have a public folder called "Bob" with replicas on 3 servers (ServerA, ServerB, ServerC) If I drill down to Folders/Public Folders Select the "BOB" public folder and select the "Status Tab" on say ServerA, I see all 3 replicas listed as expected: If I right click a replica I can select "synchronize now" what does this do exactly? Does it: 1) Push updates out from the replica where you right click and select "synchronize now" ...

Embedded Function for a range of answers
I apologize because I know that someone has probably asked this before but I have tried Ecel help and have searched the forum to no avail. I want to create a formula that will give me a specific answer base upon the results of a calculation in another cell. For instance, an this isn't what I want to do, but it is the easiest way to explain it Say that a cell would have a percentage in it, I want the formula fo the next cell to result in a letter grade based upon the percentage i the aformentioned cell. So, say there is an 89% in cell A1, A2 shoul return a "B", but if there is ...

Lookup/match function
With these functions they find the highest value which is less than or equal to the lookup value. For example A B 1 30 2 60 3 70 4 80 5 100 If I want the lookup the 'A' value of 66 it will return '2'. I want to lookup the highest value ie anything over 60 return value of 3. Anybody have any ideas ? Simon -- spgprivate ------------------------------------------------------------------------ spgprivate's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=35862 View this thread: http://www.excelforum.com/showthread.ph...

How to create MFC child window with parent given as HWND ?
Can I create a window with some template parent and after it just call : ::SetParent( m_cWnd.m_hWnd, hWnd ); on MFC widow. Will it work ? Thanks in adwance, Adam Avoid the use of SetParent. What is it you are trying to do? There is no such thing as "creating a window with some template". There is creating dialogs from templates, and creating windows. In either of these cases, you specify the parent, so there is no need to SetParent. Generally, if you are using SetParent, you are either doing something completely wrong, or there is a better way to do it. joe On Fri, 18...

Incrementing/decrementing column characters using only worksheet functions?
How can I increment and decrement column characters/letters using worksheet functions? I have a list of 5 characters corresponding to columns. The first character might be A, for column 1. How can I get the second character in the list to automatically configure itself to be B, the third C, the fourth D and the fifth E? That is, I want to set this up so that the second character is linked to the first, the third to the second and so on. That way if I change the first character from A to D then the second character in the list will automatically become E, the third will change to F, the f...

calling constructor from CString
Hi can i call a constructor of a class, if the name is stored in a CString Object e.g. class CBaseClass { int x; }; class CDerClass1: public CBaseClass { int y; }; class CDerClass2: public CBaseClass { int z; }; CString strClassName; // = L"CMyClass";//using unicode charset.... //main1//i know this CBaseClass* pPtr; ------ ---- ---------- if(some condition) { strClassName = L"CDerClass1" pPtr = new CDerClass1; } else { strClassName = L"CDerClass2" pPtr = new CDerClass2; } //for 2 classes this approach is fine but //what if i have more than 100 clas...

"Save As" function issues
Every time I try to use the "Save As" function in Microsoft Word, my PC tries to open a completely unrelated program (AutoManager WorkFlow 6.1 - by Cyco software). I am running Microsoft Office Word 2007 (12.0.6504.5000) SP2 MSO (12.0.6514.5000) on Windows Vista Enterprise (Service Pack 2). Is this most likely an issue with the settings in Microsoft Word, or in the AutoManager Workflow program? Are you accessing Save As with a keyboard shortcut (presumably one you assigned to it)? If so, it may be being overridden by a different assignment to that combination in Windo...

Call Stack Available ?
When browsing the Locals Window, I happened upon the call stack display. I looked in Help but could not find a way to access it with VBA. It might be handy in error processing in knowing how you got somewhere. If it's available, how do you access it? Thanks. -- Neal Z There is no way of accessing the call stack from VBA. For widely distributed addins I maintain my own global VBA stack array by adding the name of the function/sub into an array at the start and subtracting it at the end. Then the error handling can display where the error has occurred. I also use line n...

No data event function
Hello. I have many reports and am trying to use a function to display a message when there is no data in the report: "Report has no data." The function seems to work in that if there is data, a report runs with the data. However, if there is no data, the report does not run but "Report has no data" does not appear to the user. I'd appreciate suggestions. Public gfReportHasNoData As Boolean Public Function PrintPreviewReport(pstrReport As String, pfPreview As Boolean, pstrWhere As String) As String 'Comments: Print or preview a report and handle errors 'ps...

Sum If Function
In one column I have different qualifiers. In another column I have data. I want to create a formula that will sum all of the date in the second column that is in the same row as the qualifier in the first column. For example, if the entry in the first column=A, then I want it to include the number in the second column in the Sum. -- bhigdon ------------------------------------------------------------------------ bhigdon's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=23686 View this thread: http://www.excelforum.com/showthread.php?threadid=388383 "...

Function help #3
dear freinds: I have some problems with this data, how can I get the results thats shows in results column; YEARS DATA RESULTS 1995 100 0 1996 90 0 1997 120 2 1998 100 1 1999 150 4 2000 70 0 2001 80 1 2002 30 0 2003 150 7 2004 140 7 for example second 150 there are 7 number smallest it thank you On 18 Dec 2004 12:32:41 -0800, adahamsheh@yahoo.com (Ahmad) wrote: >dear freinds: >I have some problems with this data, how can I get the results thats >shows in results column; > > >YEARS DATA RESULTS >1995 100 0 >1996 90 0 >1997 120 2 >1998 100 1 >1999 150 4 >...

Calling a worksheet with an inputbox
Hello, I am writing a vba code where I want to copy some range "RAN" (well specified)from worksheet "WSname" (name not yet known) in workbook "WBook" to a specific worksheet in another workbook. I want to do this by clicking my way to "WSname". So I started out like this : Dim fileToOpen$ ChDir "C:\" fileToOpen = Application.GetOpenFilename("xls files (*.xls), *.xls") If fileToOpen <> "" Then Workbooks.Open Filename:=fileToOpen End If This works fine but now I want to get to this sheet "WSname" by jus...

CListCtrl w/ LVS_OWNERDRAWFIXED
I have an owner drawn CListCtrl with LVS_REPORT style. I want to draw my own thing in one of the columns only. The rest of the columns I'd like to appear just as if the CListCtrl was not owner-drawn. What's the easiest way to accomplish this? The code I have from http://codeguru.earthweb.com/listview/sel_row.shtml includes code to draw standard text in the same style as the standard list control, but if possible I'd like to remove that and just have the standard list control process the drawing of the other columns. Thanks, David http://www.dcsoft.com "David Chin...

TABLE Function/Array HELP!!!
{=TABLE(,B13)} Can anyone tell me what this array function is doing and how it works? Any help is greatly appreciated! It is not an array function. The cell is part of a Data Table. You create Data Tables (in Excel 2003 and before) in the Data>Table menu command. In Excel 2007 it is in the Data tab, Data Tools block, What-if analysis drop down. Data tables should not be confused with Tables in Excel 2007. -- Kind regards, Niek Otten Microsoft MVP - Excel "chris" <csnishimoto@yahoo.com> wrote in message news:0ba2e359-df45-4c9d-9216-2aa091f83ef7@u12g2000prd.googlegroup...

GROWTH function falls over..
Hi All I am using the GROWTH function to calculate the y-axis intercept (i.e. value of y at x = 0) for an exponential function where I have four (x,y) values. This works fine, but if the user goes back and deletes one of the input data points (say if they decide it is a rogue point ...or just do it out of mischief!) the function fails (returns #VALUE). I have a trendline based on the extrapolated line which then also falls over. I get the same result if I calculate the slope and intercept using LOGEST and then use the formula to calculate y at x=0. Any way around this? I would like to instru...

Change Childs parent
I have a child control derived from CCombo box, and I want to change it's parent based on which page of a tab is selected. After I change the parent to the new window(using SetParent), the old parent window still gets all the messages from the control. What am I doing wrong? Try changing owner as well. Use SetOwner to change it. --- Ajay "Ajay Kalra" wrote: > Try changing owner as well. Use SetOwner to change it. > > --- > Ajay > I get the same behavior. I think you can use CWnd::SetParent(): http://msdn2.microsoft.com/en-us/library/hsybbxh6(VS.80)...

Restore the auto save function, it was a life saver.
Excel 2000 used to have an autosave function, which was slightly annoying since it always prodded you to accept the save, but it was a good function. Office 2003 eliminated that and confused the issue with the auto recovery function, and yes, you were cautioned that it did not act as "save". But why did MS have to eliminate a good function. Last night I did some work on an Excel workbook, got distracted, went to bed without saving the changes. Overnight MS updated my computer with some security changes and re-started it which wiped out the work I did. And another thing, w...

calling unmanaged code in Win32 API
Hi! When I looked in the doc for the Win32 API CreateCompatibleBitmap I saw these two Library Gdi32.lib DLL Gdi32.dll I know what a DLL is because that's what I use when callingWin32 API from managed code but what is the Gdi32.lib ? //Tony Hi Tony, Tony Johansson wrote on 29.04.10 in microsoft.public.dotnet.languages.csharp > When I looked in the doc for the Win32 API CreateCompatibleBitmap I saw > these two > Library Gdi32.lib > DLL Gdi32.dll > I know what a DLL is because that's what I use when callingWin32 API from > man...