Will the CTreeView get this notification?

Hello, I have a frame window with a CSplitterWnd. The splitter window 
has two panes. One of the panes is a class derived from CTreeView (which 
contains a CTreeCtrl if I'm not mistaken) When the selection in the tree 
changes a TCN_SELCHANGE notification is sent to the parent...I thought 
the parent in this case would be my CTreeView derived class (named 
WindowView) but that doesn't seem to be true because the expression in 
the if statement below never evaluates to true no matter how many times 
I select an item in the tree...

BOOL
WindowView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult)
{
    NMHDR *nmhdr = reinterpret_cast<NMHDR*>(lParam);

    ASSERT(nmhdr);

    if (nmhdr->code == TCN_SELCHANGE) // This expression is never true...
    {
       TRACE("TCN_SELCHANGE\n");
       TRACE1("%i\n", nmhdr->idFrom);
    }

    return CView::OnNotify(wParam, lParam, pResult);
}

It gets notifications, just not the one I'm looking for... why not? 
Isn't WindowView parent of its embedded CTreeCtrl? If it isn't does that 
mean the CSplitterWnd gets the notfication? I haven't even subclassed 
the splitter itself.

- Eric
0
5/19/2007 9:24:29 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
358 Views

Similar Articles

[PageSpeed] 56

Eric Lilja wrote:
> Hello, I have a frame window with a CSplitterWnd. The splitter window 
> has two panes. One of the panes is a class derived from CTreeView (which 
> contains a CTreeCtrl if I'm not mistaken) When the selection in the tree 
> changes a TCN_SELCHANGE notification is sent to the parent...I thought 
> the parent in this case would be my CTreeView derived class (named 
> WindowView) but that doesn't seem to be true because the expression in 
> the if statement below never evaluates to true no matter how many times 
> I select an item in the tree...
> 
> BOOL
> WindowView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult)
> {
>    NMHDR *nmhdr = reinterpret_cast<NMHDR*>(lParam);
> 
>    ASSERT(nmhdr);
> 
>    if (nmhdr->code == TCN_SELCHANGE) // This expression is never true...
>    {
>       TRACE("TCN_SELCHANGE\n");
>       TRACE1("%i\n", nmhdr->idFrom);
>    }
> 
>    return CView::OnNotify(wParam, lParam, pResult);
> }
> 
> It gets notifications, just not the one I'm looking for... why not? 
> Isn't WindowView parent of its embedded CTreeCtrl? If it isn't does that 
> mean the CSplitterWnd gets the notfication? I haven't even subclassed 
> the splitter itself.
> 
> - Eric

Ok, what I had to do was replace TCN_SELCHANGE with TVN_SELCHANGED 
(silly bug by me) and subclass the CSplitterWnd and handle OnNotify. 
That way I get notified about selection changes and can respond 
accordingly. If anyone knows about a cleaner way (that, perhaps, will 
allow me not to have to subclass CSplitterWnd), I'd like to hear that as 
well. :) But this works for now...

- Eric
0
5/19/2007 11:56:25 PM
Reply:

Similar Artilces:

mail will not open
when trying to open some...not all...emails I get the message "there was an error opening this message.....an error has occurred". This doesn't happen to all messages nor does it happen to all messages from the same sender. "velona" <velona@discussions.microsoft.com> wrote in message news:5CFA4037-506D-4362-B110-13A9915D825A@microsoft.com... > when trying to open some...not all...emails I get the message "there was > an > error opening this message.....an error has occurred". > This doesn't happen to all messages nor doe...

Excel 2007 will not refresh cells
I am currently using Excel 2007. I have a spreadsheet that I want to use to do some analysis of various situations. So here is my problem. I have several columns that have totals at the bottom. I have no problem getting the columns to total initially. However, if I plug in another number in the column, the total stays the same and won't refresh or re-total the column. I don't recall that this was a problem when I worked with Excel 2003. Can someone please tell me how to get the totals to update when I enter some new numbers in the column? Thanks in advance for the...

need to get rid error message
Last month I tried to install Symantec's Winfax software on my XP Pro machine. For whatever reason, it kept crashing during the installation, and I couldn't figure out a way around it. Now whenever I first start Word or Excel, I get an error message that says: Compile error in hidden module: WinFaxPrintAndMerge I can click OK and it goes away, but what do I need to do to make it so that message doesn't appear again? In other words, how do I fix whatever it is that it thinks is wrong? Any help you can provide would be much appreciated. Thanks. By the way, I'm usin...

Where can I get the best template for a Family Address/Phone etc..
Should I use Access ro Excel? Use Outlook! What would you use the list for? Cheers John "cd" <cd@discussions.microsoft.com> wrote in message news:5F7D1417-FB16-45CB-B7FB-AC4675E83FF1@microsoft.com... > Should I use Access ro Excel? Microsoft has a Template for Access. Personal address book database http://office.microsoft.com/en-us/templates/TC010185811033.aspx I have not used it yet though. -- Dana DeLouis Win XP & Office 2003 "cd" <cd@discussions.microsoft.com> wrote in message news:5F7D1417-FB16-45CB-B7FB-AC4675E83FF1@microsoft.com... &g...

subform will not refresh
I have a subform for jobs to be at list - when I am int the actual form it requeries and shows only the ones checked off - when I go to the mainform with the jobs to be at list as a subform - it does not refresh or requery unless I close and open back up again. I had added a refresh command button with the following code: DoCmd.RunCommand acCmdRefresh when i press the refresh button it refreshes the job list to be at I add this code to the Onload of the Main form - don't want user to have to press refresh button but it doesn't refresh jobs to be at list unless press ...

How can I get my inbox returned to my isp?
I imported my yahoo inbox into outlook thinging that I could access them (my inbox and the imported inbox) from either Outlook or SBC Yahoo. Everything imported okay, except that everything is marked unread. However, I went to my Yahoo webmail, and to my terror, my inbox was empty. How will I ever be able to access my mail from out there (in the world)? Can I even undo this? deedee wrote: > I imported my yahoo inbox into outlook thinging that I could access > them (my inbox and the imported inbox) from either Outlook or SBC > Yahoo. Everything imported okay, except that ever...

Comments get out of alinement
I have a couple of thousand rows with a hundred comments which I'm showing. When I edit some data which will make a cell larger or smaller it will throw all my comments which I'm showing out of whack. What can I do about this? Debra Dalgleish has some macros that will resize or reposition the comments: http://contextures.com/xlcomments03.html Richard wrote: > > I have a couple of thousand rows with a hundred comments which I'm showing. > When I edit some data which will make a cell larger or smaller it will throw > all my comments which I'm showing out of wh...

You will pass all the exams at 1st attempt No more headaches and worry about spending the time and money to attempt another exam again. You will pass all of your exams, every time www.FreeExamKing.com
You will pass all the exams at 1st attempt No more headaches and worry about spending the time and money to attempt another exam again. You will pass all of your exams, every time www.FreeExamKing.com ...

How to get elements from XML using DOM in Javascript
I am getting an error... elem is null or not an object using the following Client side javascript. Can someone give me some help? Thanks in advance. <XML ID="PB"> <ProductItem> <Product ID="Adhesive"> <ItemType>Machine</ItemType> </Product> </ProductItem> </XML> <script language=javascript> var root = new ActiveXObject("Microsoft.XMLDOM") var xmldoc = new ActiveXObject("Microsoft.XMLDOM") xmldoc.async = false; xmldoc = document.getElementById("PB"...

messages will not display on Outlook Express
I cannot get my messages to display the text of the message. I can send and receive, but when I actually try to open a message the message will pop up, but without text. The hourglass icon is displaying, seeming like it's trying to pull the message up but it never comes. Does anyone know what I should do? anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com> wrote: > I cannot get my messages to display the text of the > message. I can send and receive, but when I actually try > to open a message the message will pop up, but without > text. ...

How do I get Outlook 2007 to print only the weeks I select?
I can't seem to get the Print Range to work in Outlook 2007. No matter what range I put in, Outlook prints a 6 week calendar (except for Feb, which it prints 5 weeks). I've tried deselecting the "print exactly one month," but that button seems to be useless for me. I have SP2 installed. I tried using the Calendar Printing Assistant, and while it will print the month out correctly, it will not print my category colors, so it is not useful for me. Bottom line is I need to see more appointments on my monthly view print out, and I can do this if I print 4 or...

Input period, but get .+
When typing entries in an EXCEL cell, I want to end the sentence with a period. However, a plus sign appears after each period and I have to go back and delete it. It's only been happening the last couple of weeks, but I don't understand why. Did I inadvertently change something in the formatting? Cameron :confused: -- Cameronsmi ------------------------------------------------------------------------ Cameronsmi's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24491 View this thread: http://www.excelforum.com/showthread.php?threadid=380882 Check y...

Getting Mac client to connect to Exchange 2003
Hello: I just upgraded from Exch 5.5 to Exch 2003. After the upgrade everything was fine but my Mac users. They can not connect to it. They are using various different versions. I know one is Outlook:Mac 2001. Does anyone know what I need to do to get these systems working? Thanks. Harrison Midkiff Harrison Midkiff <HMidkiff@aviinc.com> wrote: > Hello: Hi, > I just upgraded from Exch 5.5 to Exch 2003. After the upgrade everything > was fine but my Mac users. They can not connect to it. They are using > various different versions. I know one is Outlook...

Contracts and Kits
We have some items that were set up as kits. One component if the kit is a serialized part that is contractible. We use the Field Services Contract Administration module for contracts. Now these kits are being sold and when the contract created from the SOP transaction, the Kit item comes across to the contract instead of the components that make up the kit. Unfortunately the person that set up the kits didn't test the process first to make sure that it would work when the kit was used to set up a contract. So is there something in GP that I need change to pull the kit components ...

My Money Side will not stop
I read the FAQ for Money 2002 and it stated A) Click Help in MoneySide, then Settings. Under "Open MoneySide" select "Never" and then "Done." I select "Never" but there is no "Done" I can find and My Money leaves for this time only to return again. Is there any way to kill money from running in the background. It is not running in MSCONFIG on my XP sp2 system that I can find. Thanks Don I wish I had a way to test this here to tell you how to do it and validate the FAQ. Hopefully somebody who can still test on M02 will join the thread....

with Publisher or Office.Will I be able to access old files docume
I am frustrated with my Open Office org. program for many reasons. I would like to use Publisher or Office or? Will I be able to access, email, documents etc files previously made on another program if I download Publisher or Office or ? Erica wrote: > I am frustrated with my Open Office org. program for many reasons. > I would like to use Publisher or Office or? > Will I be able to access, email, documents etc files previously made on > another program if I download Publisher or Office or ? Office applications cannot open OpenDocument files. You will have to convert them to O...

Player will analyze and prepare music to burn but will not burn.
I recently updated to Version 11 and now my WM Player will Analyze and Prepare each song that is in the burn cue but as it initiates the transfer of the music to the disc, it generates a problem. As it starts the first song, it shows the message "finalizing disc" next to the first song. Then the burn ceases and the message " Windows Media Player can not burn files to the CD. Verify that the disc is clean and not damaged. If necessary, select a slower recording speed or try a different brand of blank discs." I tried two brands and tried several new clean d...

Problem getting node
I'm having a problem in by VB.net 2005 application. When i try to get a node from my app.config file the node come back with "nothing". The xmldocment loads OK, but I can't retrive a node. The app.config file is listed below and the code is listed below that, the line with "-->>" is where i try to get the node. Can anyone see where I'm going wrong. A dump of the xmlDocument is listed below the code. Note: "MyKey" is set to "Reports" Thank, John johnw@iirp.coedu.usf.edu App.config file ------------------------------------------...

Think I will be staying with Money2004 for good...
Just to throw my two cents in on all this money2007 stuff. It looks like MS doesn't care about users of older versions of money. With all the changes, I think they just hope to pick up new customers who don't know any better. Based on what I have read...I won't even bother trying a trial of 2007. Granted the other software out there in the personal finance space isn't that great, at least I have a decent version of money with 2004. C Money 2004 was the last best version of Money to be sure. When Money 2005 dropped I tried it for about a week and then moved to Quick...

two stations same login, one gets "you do not have permission to send to this recipient"
Exchange 2003 on server 2003, stations are running windows xp with outlook 2003. They are connected to a mailbox for a different login but they have full mailbox rights. I can send fine from one station, but the second station gets this error. On 4 Jan 2007 09:57:28 -0800, "kharnal" <kharnal@gmail.com> wrote: >Exchange 2003 on server 2003, stations are running windows xp with >outlook 2003. > >They are connected to a mailbox for a different login but they have >full mailbox rights. > >I can send fine from one station, but the second station gets this &...

Form/Subform Will Not Open
Access 2003 desktop application ....... When I try to open a form/subform I get the message: "Could not use <name of backend file>; file already in use." What could be causing this message to appear? If I click OK, the form opens with just a blank space for the subform. If I remove the control source from the subform control, the main form opens correctly. I can open the subform by itself with no problem. I have rebuilt the form/subform and get the same message. Thanks for any ideas! Steve "Steve" <notmyemail@address.com> wrote in me...

E-mail folders will not open when Outlook installed
After OUTLOOK 2002 was installed on my computer it would not work properly, and the following error message was received: "Unable to open your default e-mail folders. The .DLL file for the information service could not be found." "MAPI was unable to load the information service PSTPRX.DLL. Be sure the service is correctly installed and configured." See if the information in the following MSKB article helps: http://support.microsoft.com/default.aspx?scid=kb;[LN];293058 -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered ...

Getting error while creating a user
While creating a new user in CRM 3, I am getting the following error Data Out of Range Maximum character limit has exceeded for atleast one field Removed data from all the fields except ofcourse Domain Log on, First Name and Last Name. Even then I am getting the same error message. Tried from Deployment Manager, and same problem. It is happening only for this user. Any lead?? Detail stack is given below and I cannot make out anything from that. Server Error in '/' Application. -------------------------------------------------------------------------------- Exception from HRESULT:...

Supplier not getting set in Item properties
I am entering an item with the new item wizard and selecting a supplier but after posting the item and clicking on its properties, there is no supplier selected. Does anyone know why that could happen? Thank you. What version of RMS are you using. I am using version 1.2.0151 and the supplier is populating as required. I would be interested to know if this is a fault created by a service pack. "Rami" wrote: > I am entering an item with the new item wizard and selecting a supplier but > after posting the item and clicking on its properties, there is no supplier > sel...

Get Value Of Drop-Down List Box Using C#
Get Value Of Drop-Down List Box -------------------------------------------------------------------------------- Hi, I'm not sure whether to ask this question in C# Forum or Excel Forum I've asked this on a C# forum but hasn't got reply. My task is to read an excel file using C# , and get the selected item of a Drop-down List Box. Can someone help me with this ? Another question is , can I have a value for each item in a drop-dow list box , beside the text that was shown ? What I mean is like in HTML , we can have "value" attribute for eac "<option>&...