Results 1 to 2 of 2

Thread: printing problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    4

    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

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width