print a window
-
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 !!!!!!!!!!
-
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 !!!!!!!!!!
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.