Sign in to follow this  
xIshtarx

Using the printer

Recommended Posts

xIshtarx    122
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
Toolmaker    967
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this