Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting a Document pointer from a dialog derived

Status
Not open for further replies.

bulgakov

Programmer
Apr 24, 2003
26
GB
WEhats the best way to get a pointer to the document
from a CDialog derived class ? And a pointer to the view ?

I am developing an MDI.

Thanks

Marcus
 
Marcus,

I would guess for an MDI application the best way would be for the code creating the Dialog to pass the document object as a parameter to the Dialog. This could be done with a constructor or even a set(..) function.

Another consideration would be if your logic determines that the dialog always works with the Active Document. In that case you could use the CFrameWnd::GetActiveDocument() function.

The same logic would apply to obtaining the View object.


-pete
I just can't seem to get back my IntelliSense
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top