Results 1 to 2 of 2

Thread: More Doc/View issues

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471

    More Doc/View issues

    im using some 3rd party code (BCG to be exact). I'm forced to
    derive an object from the TreeCtrl in order to create the
    control which i place inside one of the control bars that BCG
    offers. How would i access the Document from this ctrl?

    Any help or better advice for this is greatly appreciated.
    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You have two options:
    a) AfxGetMainWnd()->GetActiveView()->GetDocument();
    (not sure if those names are correct)
    This works only if the view the control belongs to is active. This means it may not always work and therefore is no good way.

    b) Add a member to your derived class where you store a pointer to the document. Pass that pointer at creation time. Works only if you have access to the document at this time, but you usually should have.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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