CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Doc to view?

  1. #1
    Join Date
    Apr 1999
    Posts
    79

    Doc to view?



    Hello:

    I use VC++6.0 MFC.I read data file in Doc Class(archieve()).

    How can I send the data from doc class to view class?

    Would you help me?

    Yoh-Hei

  2. #2
    Join Date
    May 1999
    Location
    Antwerp, Belgium
    Posts
    136

    Re: Doc to view?



    With the UpdateAllViews-method of the CDocument-class you can notify your

    views of updates in the document.

    This method calls the CView::OnUpdate method for each of the document's view.



  3. #3
    Join Date
    Jul 2000
    Location
    fairfax,va,usa
    Posts
    4

    Re: Doc to view?

    the doc is meant for containg the data. so read all the contents and store them in variables in document class. now access these variables from the view class using the pointer to document. you can get pointer to the document using GetDocument() in your view class. If already there is a code in OnDraw( ) which uses the data variables in the document class simply call the UpdataAllViews() after serializing the data in document class. This will call the OnDraw function of all the existing views. So the code written in OnDraw will use the new values.

    thankyou,
    prasanth


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured