Use ShellExecute()
ShellExecute(m\_hWnd, "print", "MyFile.txt", NULL, NULL, SW\_HIDE);
This will execute the program associated with the .txt extension and tell it to print the file.
Use system()
system("copy "MyFile.txt" lpt1:");
This will send the file to the printer using the DOS copy command. Note that the last (partial) page will probably not be printed, unless you send a formfeed.
Use MFC's doc/view printing architecture. See the Printing section here on CP for more details.
HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.