…based on a “Corner of calmness” photo from my Film is not dead, no. 2 session.
Hope you like it. 🙂
There is no big science to it, but thanks to a “bad choice of title”, the appropriate MSDN-KB-HOWTO article is not easy to find. So, here’s a link:
The above link takes you directly to the code snippet that sets print orientation to landscape; to change the orientation to portrait, you only need to change the DMORIENT_LANDSCAPE to DMORIENT_PORTRAIT; of course, the easiest way is to change the function to allow user to choose the orientation.
Note: The presented code, of course, also changes the orientation of the print preview.
To use the above code, simply surround your printing (or print preview) code with (provided you changed the function to accept bool to choose orientation, and to return previous setting):
CMyApp* app = (CMyApp*) ::AfxGetApp(); bool old_po = app->SetPrintOrientation(*your choice of orientation*); // printing (or print preview) code comes here app->SetPrintOrientation(old_po);
Note: So far, I didn’t manage to find a way to change the print orientation for individual pages; seems like you have to print portrait and landscape oriented pages in separate print jobs (?).
It’s possible to refer to e.g. My Documents folder on your own computer by the path you know, and it’ll work. But if you want to distribute your program among users, you cannot expect the fixed path to work. E.g. Windows allow you to save user’s profile folders anywhere on the disk you want; it’s not a rule that all are saved under Documents and Settings; e.g. mine are saved under folder called Profiles, since I wanted to preserve the original Documents and Settings from my previous Windows installation. Also, Windows need not to be installed under C:\Windows; mine are under C:\Windows.1.
But, there is a (quite) simple way to find all the necessary system folders in Windows. All you have to do is be a bit careful.
Here are few of my favourite music compositions for (do I have to emphasize, free?) download.
Johann Pachelbel – Canon – ca 1680, simply amazing!
This is a simple tutorial on how to create panoramas in Photoshop (in my case version 7, but applies to any Photoshop from version 6 up).
As the May already started, here are few pix of our kitten from April ’08, in all its sweetness, sleepiness, and playfulness… Enjoy!