CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2005
    Posts
    19

    Print in PrintPreview problem

    After I derived my View from CPreview, i have now a preview screen but when i am in my preview screen and when i print or when i close this screen the program broken down, what to do ?

  2. #2
    Join Date
    Jun 2005
    Location
    Chennai , India
    Posts
    1,375

    Thumbs up Re: Print in PrintPreview problem

    check it in ur CView:
    debug and check ,
    and try doing direcly into ur print that is [
    Code:
    ID_FILE_PRINT
    instead of print preview.it helps u to find the issue (if any) easier .
    It takes seconds for rating…that actually compensates the minutes taken for giving answers
    The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
    Regards, Be generous->Rate people
    Jayender!!

  3. #3
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    Re: Print in PrintPreview problem

    You should not derive you view from CPreviewView. You should make sue of the standard MFC print/preview architecture.

    To do this derive from CView and override the OnPreparePrinting/OnBegin/EndPrinting and OnPrint functions.

    You should then just only need to add a ON_COMMAND(ID_FILE_PRINT_PREVIEW, ONPrintPreview) handler to get a free preview function.
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

  4. #4
    Join Date
    Aug 2005
    Posts
    19

    Re: Print in PrintPreview problem

    I don't understand well,
    Would you like to send me an example

    Please

    Thanks

  5. #5
    Join Date
    Jun 2005
    Location
    Chennai , India
    Posts
    1,375

    Re: Print in PrintPreview problem

    if u can attach ur function ...then it will be a very good help to know the bug .
    It takes seconds for rating…that actually compensates the minutes taken for giving answers
    The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
    Regards, Be generous->Rate people
    Jayender!!

  6. #6
    Join Date
    Aug 2005
    Posts
    19

    Re: Print in PrintPreview problem

    Please Sir ,

    When I derive a view from CView i have this error :cannot instantiate abstract class due to following members: impression(name of my view) in this ligne of impression.cpp: IMPLEMENT_DYNCREATE(impressionnat,CView)

    That 's why i want that you send me an example.

    The first view when i generate the project is working well and print preview is working well, but when I make an another view i have many probleme.

    What to do exactly

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

Featured