Link to home
Start Free TrialLog in
Avatar of scs1
scs1

asked on

Printing a text file with a MFC application

I have a MFC application that when the user selects the menu item <PRINT REPORT> it writes a lot of formatted text to a text file. I want the program to then send the file to the default printer to be printed.  How do I do that?

I realize this is not the best way to a print a file with a MFC application.  However, I already have the text file formatted and would like to simply print that text file.
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scs1
scs1

ASKER

Thank you very much for your help. However, I do not know how to set the windows handler (hWnd) to the notepad.  When I run the program with the line above it tries to print, but an error box pops up saying that the notepad handler is invalid.  How do I set it?
Avatar of scs1

ASKER

Forget the previous comment.  My problem was related to a printer setup problem with my computer.  I have corrected the problem and everything works great.  Thank you very much.