CDialogBar - Programmer

This is a discussion on CDialogBar - Programmer ; Hello How can i transfer data between CDocument and CEdit that belongs to CDialogBar (is there any simple - suitable way that do not involve CFrameWnd or CView) thx...

+ Reply to Thread
Results 1 to 5 of 5

Thread: CDialogBar

  1. CDialogBar

    Hello
    How can i transfer data between CDocument and CEdit that belongs to
    CDialogBar (is there any simple - suitable way that do not involve
    CFrameWnd or CView)

    thx

  2. Re: CDialogBar

    Piotrek wrote:
    > Hello
    > How can i transfer data between CDocument and CEdit that belongs to
    > CDialogBar (is there any simple - suitable way that do not involve
    > CFrameWnd or CView)
    >
    > thx


    The CDocument and CDialogBar will need pointers to each other in member
    variables. You can initialize those pointers during startup.

    --
    Scott McPhillips [VC++ MVP]


  3. Re: CDialogBar





    > The CDocument and CDialogBar will need pointers to each other in member
    > variables. You can initialize those pointers during startup.
    >

    OK - but how to initialize without crushing the application (i am new) -
    i am trying to initilaize pointers in CMainFrame::Create() function -
    the trouble is that GetActiveDocument() returns NULL - the document
    isn't active yet .So there is next question : where to initialize
    pointers ? (probably the answer is simple - but i am too tired now to think)

    thx for help

    ps
    in my opinion document-view architekture sux (moving between main
    classes is to complex - or i dont know the bright side of mfc yet

  4. Re: CDialogBar

    Piotrek wrote:
    >> The CDocument and CDialogBar will need pointers to each other in
    >> member variables. You can initialize those pointers during startup.
    >>

    > OK - but how to initialize without crushing the application (i am new) -
    > i am trying to initilaize pointers in CMainFrame::Create() function -
    > the trouble is that GetActiveDocument() returns NULL - the document
    > isn't active yet .So there is next question : where to initialize
    > pointers ? (probably the answer is simple - but i am too tired now to
    > think)
    >
    > thx for help
    >
    > ps
    > in my opinion document-view architekture sux (moving between main
    > classes is to complex - or i dont know the bright side of mfc yet


    The view is the last to be created. In the view OnInitialUpdate you can
    call GetDocument and AfxGetMainWnd. Then you can set variables in the
    doc and mainframe, or call functions that you add to them.

    The awkwardness of "moving between main classes" is a useful feature of
    C++, not really related to doc/view or MFC.

    P.S. Writing a Windows program without MFC sux even more

    --
    Scott McPhillips [VC++ MVP]


  5. Re: CDialogBar

    thx - it works
    > P.S. Writing a Windows program without MFC sux even more
    >

    true

+ Reply to Thread