I am using CView Print Preview class to display everything in print preview function. But there is a problem with GetActiveView function as it returns null

Code:
m_pView =(CViewPrintPreview*)pFrameWnd->GetActiveView();
It does have a CView Derived Class and I am creating a CDocument Object at run time. You can see the source code of the DLL (PrintReport.zip). PrintPreview is the EXE application that will run this DLL. You see there are 3 reports that are generated. For first 2 reports GetActiveView returns the handle only in case of 3rd report it returns NULL.


https://skydrive.live.com/redir.aspx...ive&Bsrc=Share


https://skydrive.live.com/redir.aspx...ive&Bsrc=Share