Printing with a CString
-
Hi, I print a CString with pDC->TextOut(). That is working. But if I print again, the sheet is blank. How to correct that? Do I have to utilize GetBuffer(), etc? Thanks, Claude
-
Hi, I print a CString with pDC->TextOut(). That is working. But if I print again, the sheet is blank. How to correct that? Do I have to utilize GetBuffer(), etc? Thanks, Claude
Just a guess, could you be overwriting the first print? Do you have a new line character (or carraige return and line feed) at the end?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
-
Hi, I print a CString with pDC->TextOut(). That is working. But if I print again, the sheet is blank. How to correct that? Do I have to utilize GetBuffer(), etc? Thanks, Claude
-
Hi, I print a CString with pDC->TextOut(). That is working. But if I print again, the sheet is blank. How to correct that? Do I have to utilize GetBuffer(), etc? Thanks, Claude
Hi, Your not really 'printing' but rather painting text using GDI if your utilizing the TextOut function[^]. Sounds like the wm_erasebkgnd handler (or conversely WM_PAINT if you are painting in the erase handler)is overwriting what you painted. You should share some code. Also recommend reading all of this: Painting and Drawing[^] Best Wishes, -David Delaune