我要在动态切分的多视图MFC应用程序中添加一个打印功能,打印任何一个想要打印的视图窗口,有什么方法吗????请不吝赐教!!!

解决方案 »

  1.   

    Write yourself printing frame.very simple procedure that reference for you as below:1.EnumPrinters : get printer info.
    using the combined flags: PRINTER_ENUM_LOCAL|PRINTER_ENUM_NETWORK
    using the level: PRINTER_INFO_2
    2.CreateDC : Create specified printer device context using PRINTER_INFO_2 gotten from above.
    3.StartDoc : Passing the just created DC for start a new print document.
    4.StartPage & EndPage : In the two functions, you should drawing some stuff which's from certain view. Note: you should may use StretchBlt for supporting mapping between screen and printer according their different DPI(resolution).
    5.EndDoc : Finishing the print document.
    6.DeleteDC: don't forget delete the DC for release resource.
      

  2.   

    I thought that above API functions should be extremely simple to satisfy your needs.