Which message is send everytime a CFormView is loaded in a CSplitterWnd - Programmer

This is a discussion on Which message is send everytime a CFormView is loaded in a CSplitterWnd - Programmer ; Hallo, I have a program with a CSplitterWnd which divides 2 CFormViews. See link: http://wwwstud.fh-zwickau.de/~pafe/geb/1.jpg When I start the program the ListBox (CListView) on the right side gets filled in the method OnInitialUpdate(). When I navigate through the tree then ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Which message is send everytime a CFormView is loaded in a CSplitterWnd

  1. Which message is send everytime a CFormView is loaded in a CSplitterWnd

    Hallo,
    I have a program with a CSplitterWnd which divides 2 CFormViews.
    See link: http://wwwstud.fh-zwickau.de/~pafe/geb/1.jpg

    When I start the program the ListBox (CListView) on the right side
    gets filled in the method OnInitialUpdate().

    When I navigate through the tree then the views on the right side are
    replaced.
    When I come back to the element, that displays the form with the
    List-Box, my ListBox is not filled with the data I provide in
    OnInitialUpdate.
    See link: http://wwwstud.fh-zwickau.de/~pafe/geb/2.jpg

    Now my question is:
    Where do I have to put the code (what message do I have to catch) to
    get the ListBox filled everytime I select the corresponding
    tree-element.

    Thx 4 ur help

    Pedde

  2. Re: Which message is send everytime a CFormView is loaded in a CSplitterWnd

    Pedde wrote:
    > Hallo,
    > I have a program with a CSplitterWnd which divides 2 CFormViews.
    > See link: http://wwwstud.fh-zwickau.de/~pafe/geb/1.jpg
    >
    > When I start the program the ListBox (CListView) on the right side
    > gets filled in the method OnInitialUpdate().
    >
    > When I navigate through the tree then the views on the right side are
    > replaced.
    > When I come back to the element, that displays the form with the
    > List-Box, my ListBox is not filled with the data I provide in
    > OnInitialUpdate.
    > See link: http://wwwstud.fh-zwickau.de/~pafe/geb/2.jpg
    >
    > Now my question is:
    > Where do I have to put the code (what message do I have to catch) to
    > get the ListBox filled everytime I select the corresponding
    > tree-element.
    >
    > Thx 4 ur help
    >
    > Pedde


    When the tree selection is changed the left view should put data in the
    document and call UpdateAllViews. This will call OnUpdate in the right
    view. OnUpdate can read data from the document and update the list box.

    --
    Scott McPhillips [VC++ MVP]


  3. Re: Which message is send everytime a CFormView is loaded in a CSplitterWnd

    Hi and thanks for your post.
    When I do the
    this->GetActiveDocument()->UpdateAllViews(NULL,0L,NULL);
    in a method of CMainFrame (because the Tree is calling a method of
    CMainFrame) then I get the following error (see link)
    Link: http://wwwstud.fh-zwickau.de/~pafe/geb/error2.jpg

    Pedde

    "Scott McPhillips [MVP]" wrote in message news:...
    > Pedde wrote:
    > > Hallo,
    > > I have a program with a CSplitterWnd which divides 2 CFormViews.
    > > See link: http://wwwstud.fh-zwickau.de/~pafe/geb/1.jpg
    > >
    > > When I start the program the ListBox (CListView) on the right side
    > > gets filled in the method OnInitialUpdate().
    > >
    > > When I navigate through the tree then the views on the right side are
    > > replaced.
    > > When I come back to the element, that displays the form with the
    > > List-Box, my ListBox is not filled with the data I provide in
    > > OnInitialUpdate.
    > > See link: http://wwwstud.fh-zwickau.de/~pafe/geb/2.jpg
    > >
    > > Now my question is:
    > > Where do I have to put the code (what message do I have to catch) to
    > > get the ListBox filled everytime I select the corresponding
    > > tree-element.
    > >
    > > Thx 4 ur help
    > >
    > > Pedde

    >
    > When the tree selection is changed the left view should put data in the
    > document and call UpdateAllViews. This will call OnUpdate in the right
    > view. OnUpdate can read data from the document and update the list box.


  4. Re: Which message is send everytime a CFormView is loaded in a CSplitterWnd

    Pedde schrieb:

    > When I do the
    > this->GetActiveDocument()->UpdateAllViews(NULL,0L,NULL);
    > in a method of CMainFrame (because the Tree is calling a method of
    > CMainFrame) then I get the following error (see link)
    > Link: http://wwwstud.fh-zwickau.de/~pafe/geb/error2.jpg


    From the docu:

    CFrameWnd::GetActiveDocument

    Return Value
    A pointer to the current CDocument. If there is no current document,
    returns NULL.

    Test if GetActiveDocument() returns NULL.

    Only one idea.

  5. Re: Which message is send everytime a CFormView is loaded in a CSplitterWnd

    The GetActiveDocument() doesn't return a NULL-Value.
    When I do a:
    this->GetParentFrame()->GetActiveDocument()->UpdateAllViews(NULL,0L,NULL);

    In OnSelChanged() of the Tree-Control and I'm changing the selection
    back to the FFwEingabe then I get an assertion fail again.

    Pedde
    "Robert W. Kuhn" wrote in message news:<407f9039$0$15485$9b4e6d93@newsread4.arcor-online.net>...
    > Pedde schrieb:
    >
    > > When I do the
    > > this->GetActiveDocument()->UpdateAllViews(NULL,0L,NULL);
    > > in a method of CMainFrame (because the Tree is calling a method of
    > > CMainFrame) then I get the following error (see link)
    > > Link: http://wwwstud.fh-zwickau.de/~pafe/geb/error2.jpg

    >
    > From the docu:
    >
    > CFrameWnd::GetActiveDocument
    >
    > Return Value
    > A pointer to the current CDocument. If there is no current document,
    > returns NULL.
    >
    > Test if GetActiveDocument() returns NULL.
    >
    > Only one idea.


  6. Re: Which message is send everytime a CFormView is loaded in a CSplitterWnd

    Hallo again,
    I've put the project in MS VS 6 Format on my webspace.
    Link:
    http://wwwstud.fh-zwickau.de/~pafe/geb/Fla.rar
    I hope you can help me when you look at the code, because I'm not a
    professional in VC++.

    Hope for your help
    Pedde

    "Robert W. Kuhn" wrote in message news:<407f9039$0$15485$9b4e6d93@newsread4.arcor-online.net>...
    > Pedde schrieb:
    >
    > > When I do the
    > > this->GetActiveDocument()->UpdateAllViews(NULL,0L,NULL);
    > > in a method of CMainFrame (because the Tree is calling a method of
    > > CMainFrame) then I get the following error (see link)
    > > Link: http://wwwstud.fh-zwickau.de/~pafe/geb/error2.jpg

    >
    > From the docu:
    >
    > CFrameWnd::GetActiveDocument
    >
    > Return Value
    > A pointer to the current CDocument. If there is no current document,
    > returns NULL.
    >
    > Test if GetActiveDocument() returns NULL.
    >
    > Only one idea.


  7. Re: Which message is send everytime a CFormView is loaded in a CSplitterWnd

    Pedde schrieb:

    > Hallo again,
    > I've put the project in MS VS 6 Format on my webspace.
    > Link:
    > http://wwwstud.fh-zwickau.de/~pafe/geb/Fla.rar
    > I hope you can help me when you look at the code, because I'm not a
    > professional in VC++.
    >
    > Hope for your help
    > Pedde
    >
    > "Robert W. Kuhn" wrote in message
    > news:<407f9039$0$15485$9b4e6d93@newsread4.arcor-online.net>...
    > > Pedde schrieb:
    > >
    > > > When I do the
    > > > this->GetActiveDocument()->UpdateAllViews(NULL,0L,NULL);
    > > > in a method of CMainFrame (because the Tree is calling a method
    > > > of CMainFrame) then I get the following error (see link)
    > > > Link: http://wwwstud.fh-zwickau.de/~pafe/geb/error2.jpg

    > >
    > > From the docu:
    > >
    > > CFrameWnd::GetActiveDocument
    > >
    > > Return Value
    > > A pointer to the current CDocument. If there is no current
    > > document, returns NULL.
    > >
    > > Test if GetActiveDocument() returns NULL.
    > >
    > > Only one idea.

    Hallo,
    wenn ich folgenden Code in das Projekt einsetze:
    //Assertion Fail
    CDocument *pDocu=GetParentFrame()->GetActiveDocument();

    POSITION pos=pDocu->GetFirstViewPosition();
    while(pos!=NULL)
    {
    CView* pView=pDocu->GetNextView(pos);
    pView->UpdateWindow();
    }
    *pResult = 0;
    dann bekomme ich keinen Fehler mehr.
    Hope it helps.
    Gruss
    Roland

  8. Re: Which message is send everytime a CFormView is loaded in a CSplitterWnd

    Hallo,
    thx for your Post.
    The error doesn't occur anymore, but there's the next problem.
    The update for the right view doesn't work.
    Does anyone know how I get it work that when I click FFw-Eingabe again
    (after changing the view) that the Listbox contains the content it has
    had the first time?
    Is there an other solution?

    Thx Pedde

    ----------------------
    Hallo,
    Danke Dir jetzt ist der Fehler weg und das nächste Problem da:

    Der Updated aber den rechten View nicht.
    Kann mir jemande sagen, wie ich es jetzt hinbekomme, daß die Listbox
    auf der rechten Seite dann bei jedem Klick auf FFw-Eingabe auch
    aktualisiert wird (Quelltext in OnUpdate soll dann in entsprechender
    Funktion ausgeführt werden)
    Oder hat es andere Gründe warum am Anfang ein Bla in der Listbox steht
    und nach einem Wechsel ist die Lisbox leer.
    Wie kann ich dies beheben?

    Thx Pedde
    "Roland Wunderer" wrote in message news:...
    > Pedde schrieb:
    >
    > > Hallo again,
    > > I've put the project in MS VS 6 Format on my webspace.
    > > Link:
    > > http://wwwstud.fh-zwickau.de/~pafe/geb/Fla.rar
    > > I hope you can help me when you look at the code, because I'm not a
    > > professional in VC++.
    > >
    > > Hope for your help
    > > Pedde
    > >
    > > "Robert W. Kuhn" wrote in message
    > > news:<407f9039$0$15485$9b4e6d93@newsread4.arcor-online.net>...
    > > > Pedde schrieb:
    > > >
    > > > > When I do the
    > > > > this->GetActiveDocument()->UpdateAllViews(NULL,0L,NULL);
    > > > > in a method of CMainFrame (because the Tree is calling a method
    > > > > of CMainFrame) then I get the following error (see link)
    > > > > Link: http://wwwstud.fh-zwickau.de/~pafe/geb/error2.jpg
    > > >
    > > > From the docu:
    > > >
    > > > CFrameWnd::GetActiveDocument
    > > >
    > > > Return Value
    > > > A pointer to the current CDocument. If there is no current
    > > > document, returns NULL.
    > > >
    > > > Test if GetActiveDocument() returns NULL.
    > > >
    > > > Only one idea.

    > Hallo,
    > wenn ich folgenden Code in das Projekt einsetze:
    > //Assertion Fail
    > CDocument *pDocu=GetParentFrame()->GetActiveDocument();
    >
    > POSITION pos=pDocu->GetFirstViewPosition();
    > while(pos!=NULL)
    > {
    > CView* pView=pDocu->GetNextView(pos);
    > pView->UpdateWindow();
    > }
    > *pResult = 0;
    > dann bekomme ich keinen Fehler mehr.
    > Hope it helps.
    > Gruss
    > Roland


+ Reply to Thread