CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    VC++ 6.00: How set the landscape printing mode?

    I know that it seems to be a trivial question.
    But I did not find how to set the printing mode to landscape before displaying
    the CPrintDialog, with VC++ 6.00.
    I tried to change the DEVMODE structure with GetDevMode method but I always got
    an error: The memory could not be written.

    Help highly appreciates.
    JH MORIN.


  2. #2
    Join Date
    May 1999
    Posts
    36

    Re: VC++ 6.00: How set the landscape printing mode?

    Hi,

    There is a Knowledge Base article at Microsoft's site on how to do this. Don't have the article off hand, should be able to search for it. If you can't find it, I could post the code... let me know.

    HTH,

    Harvey Hawes

    Software Engineer
    BioScience Analysis Software Ltd.

    Masters Candidate
    Cardiovascular/Respiratory Sciences
    Faculty of Medicine
    University of Calgary
    Calgary, Alberta, Canada

  3. #3
    Join Date
    May 1999
    Posts
    25

    Re: VC++ 6.00: How set the landscape printing mode?

    This is how I do it

    LPDEVMODE lp = (LPDEVMODE) ::GlobalLock(dlg.m_pd.hDevMode);
    ASSERT(lp);
    lp->dmOrientation = DMORIENT_LANDSCAPE;
    ::GlobalUnlock(dlg.m_pd.hDevMode);
    ResetDC(dlg.m_pd.hDC,lp);


  4. #4
    Guest

    Re: VC++ 6.00: How set the landscape printing mode?

    Thanks to all.
    The code below does excatly what I wanted.

    LPDEVMODE lp = (LPDEVMODE) ::GlobalLock(dlg.m_pd.hDevMode);
    ASSERT(lp);
    lp->dmOrientation = DMORIENT_LANDSCAPE;
    ::GlobalUnlock(dlg.m_pd.hDevMode);
    ResetDC(dlg.m_pd.hDC,lp);

    Jean-Hubert Morin



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