Hi, I am trying to print content from a Win32 richedit control, but it doesn't work. The text wraps to the half width of the page, and after printing, the text in the richedit is also messed up (word wrap to the half width of the box).
I use this unmodified code taken directly from MSDN:
Oh, man, you went into a real thicket with this one.... The way I was able to even remotely come close to printing is by doing this: create a test MFC project, make it a project with a single document and derive the view class from CRichEditView. All of your answers are in that class, btw. Then in your test project override OnPreparePrinting and put a breakpoint on it. Then compile and start debugging. When the test app opens up go to File and Print. This will trigger the breakpoint. Then step into the CRichEditView and try to copy what they're doing there. (If you don't want to do it this way, look for the viewrich.cpp file in the installation folder for the Visual Studio.)
Good luck. All that stuff is largely undocumented (like pretty much anything else about rich edits).
OK thanks for your reply,
but unfortunately I have no time to implement MFC into my project. I am looking for a native Win32 solution. I know it's not very well documented, there's almost nothing on Google about that.
I know what you mean, I'm going through the same thing. OK, the last thing I'm going to post here is that MFC is simply a wrapper for your Win32 calls so if you dig deep enough you'll get to it.... you'll just have to go through the Microsoft thicket, if you know what I mean.... Good luck.