Print Preview in MFC

Visual Studio204
I am making an activex control using MFC classes.



For printing I am following this logic.



CDC *pDC = new CDC;

PrintDlg pd;

pDC->Attach(pd.hDC);

xxxxx

----Drawing logic----

xxxxxxxxxxx



How do I implement print preview with same infomation.



Is there anyway to use MFC Print preview architecture with my drawing

logic?



Thanks



Sanjiv


-