Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. print a window

print a window

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tataxin
    wrote on last edited by
    #1

    I have a MDI project, now I want to print the interface. So I saw this article: http://support.microsoft.com/kb/q186736/ Then I try to apply to my project, just create a menu item or button, do like this:

    // message map
    ON_COMMAND(ID_PRINT_PRINTALL, &CMyDlg::PrintGUI)

    // declare function
    afx_msg void PrintGUI();

    // implement function
    void CMyDlg::PrintGUI(){
    // get the Main window
    CWnd* a = AfxGetMainWnd();

        // print it, this function is implemented follow the above article
    PrintWindowToDC(\*a);
    

    }

    But when I run, nothing happen. Have anyone ever tried the similar thing? Please helpppppppp !!!!!!!!!!

    N 1 Reply Last reply
    0
    • T tataxin

      I have a MDI project, now I want to print the interface. So I saw this article: http://support.microsoft.com/kb/q186736/ Then I try to apply to my project, just create a menu item or button, do like this:

      // message map
      ON_COMMAND(ID_PRINT_PRINTALL, &CMyDlg::PrintGUI)

      // declare function
      afx_msg void PrintGUI();

      // implement function
      void CMyDlg::PrintGUI(){
      // get the Main window
      CWnd* a = AfxGetMainWnd();

          // print it, this function is implemented follow the above article
      PrintWindowToDC(\*a);
      

      }

      But when I run, nothing happen. Have anyone ever tried the similar thing? Please helpppppppp !!!!!!!!!!

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #2

      here in the CP there are articles to print a screen capture, to print from a dialog, to print using or not using MFC... I strongly recommend you to have a look into that section. IMHO the best articles are from Roger Allen, Chris Maunder, Joseph M Newc...

      Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson Rating helpfull answers is nice, but saying thanks can be even nicer.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups