• Advertisement
Sign in to follow this  

Using the printer

This topic is 4910 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi every1 Im treing to print some text with a printer. I checked msdn and i think i have to use: StartDoc(); It takes 2 parameters a HDC.. what the hell is a HDC?? and a DOCINFO. I fill in the DOCINFO like his: DOCINFO info; info.cbSize=sizeof(DOCINFO); info.fwType=0; info.lpszDatatype=NULL; info.lpszDocName="document.doc"; info.lpszOutput=NULL; Still needed a HDC, so i searched and found this: HDC hdc; CPrintDialog dlg(FALSE); if (dlg.DoModal() == IDOK) { HDC hdc = dlg.GetPrinterDC(); ASSERT(hdc); CDC::FromHandle(hdc)->DeleteDC(); } Copied it from msdn :). Then i needed to #include <afxdlgs.h> I compiled it and now i got this: afxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex I dont want any threads or stuff lol... :S Some1 help me out plz, i really dont have a clue what im doing here... Thanks in advance xIshtarx

Share this post


Link to post
Share on other sites
Advertisement
You're linking with the MFC dll's and libraries. Those libraries require a bunch of MFC standard include files.

I asked Dr. Google, and he knew quite alot of answers. After skimming over them quickly, I decided that you need to check this example:
http://www.cplusplus.com/src/hwprint.zip
It's taken from this page:
http://www.cplusplus.com/src/

Toolmaker

Share this post


Link to post
Share on other sites
Thanks alot, thats what i was looking for. I thought msdn had the answers... next time ill google first :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement