Thomas Hruska <[EMAIL PROTECTED]> wrote: chetan
verma wrote:
> Hi,
>
> I have a class uiTreeCtrl that derives CTreeCtrl, and adds some application
> dependent functionality.
>
> I have another class uiTreeWorkShell, that has a CTreeCtrl object member.
> The basic function of this class is to display a tree on left side and show
> a page on right side depending on the selected item.
>
> I am trying to use a uiTreeCtrl object instead of the CTreeCtrl object in
> uiTreeWorkShell.
>
> The uiTreeCtrl has a function OnSelChanged which is called whenever
> selection in the tree changes.
> The uiTreeWorkShell also has a function OnSelChanged that gets called
> whenever selection in its CTreeCtrl object changes.
>
> The problem i am facing is that, when I use the uiTreeCtrl object, only the
> function uiTreeCtrl::onSelChanged gets called not the
> uiTreeWorkShell::onSelChanged.
>
> Is there anyway in which both the function get called.
>
> Thanks,
> chetan
I'm somewhat confused. Got some code that we can see that demonstrates
the problem?
--
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197
*NEW* MyTaskFocus 1.1
Get on task. Stay on task.
http://www.CubicleSoft.com/MyTaskFocus/
Class uiTreeCtrl is declared as:
class uiTreeCtrl : public CTreeCtrl, public uiWnd {
public:
uiTreeCtrl();
....
protected:
afx_msg void OnSelChanged(NMHDR* pNMHDR, LRESULT* pRes);
....
}
In the implementation following message mapping is done
BEGIN_MESSAGE_MAP(uiTreeCtrl, CTreeCtrl)
ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelChanged)
....
END_MESSAGE_MAP()
uiTreeWorkShell is declared as:
class uiTreeWorkShell : public uiWorkShell {
public:
....
protected:
CTreeCtrl the_cTreeCtr;
....
afx_msg void OnSelChanged(NMHDR* pNotifyStruct, LRESULT* pResult);
....
}
in the implementation following mapping is done:
BEGIN_MESSAGE_MAP(uiTreeWorkShell, uiWorkShell)
ON_NOTIFY(TVN_SELCHANGED,ID_TREECTRL,OnSelChanged)
END_MESSAGE_MAP()
ID_TREECTRL is the ID used to create the the_cTreeCtrl object.
So, when the selection in the tree the_cTreeCtrl changes
uiTreeWorkShell::OnSelChanged() gets called.
I am trying to use uiTreeCtrl object instead of CTreeCtrl,
On doing so, when the tree selection changes, only uiTreeCtrl::OnSelChanged()
is called, uiTreeWorkShell::OnSelChanged() never gets called.
What I want is that both the fuctions should be mapped to the event, and both
of them must be called.
Thanks,
chetan.
---------------------------------
Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
[Non-text portions of this message have been removed]