We can use GetDocument to return a pointer to the CDocument associated with the view(eg CFormView).

However if i have created a dialog box (CDialog class), how do i get a pointer to the CDocument???