|
-
Mar 22nd, 2002, 02:41 PM
#1
Thread Starter
New Member
printing problem
I have problem with PrintPreview - my doc/view app has dialog where I'd like to initialise PrintView with following command CView::OnFilePrintPreview(), but there is an error *cannot access protected member declared in class 'CView'*. Can you help me wit this?
pozdr, Artur
-
Apr 2nd, 2002, 11:11 AM
#2
You could for example do:
pWnd->SendMessage(WM_COMMAND, MAKELONG(ID_FILE_PRINTPREVIEW, 1), NULL);
This will trick MFC into thinking that the user has pressed a key combination that triggers the print preview. The framework will then call OnPrintPreview.
Replace ID_FILE_PRINTPREVIEW with whatever ID the menu item in the file menu has.
Another option is to insert a public member into your view class. This member will then call OnPrintPreview from within the class.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|