CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2000
    Location
    Tehran - Iran
    Posts
    949

    Q: Copying HDC ...

    Hi there,

    In a part of my application i copied an HDC to another like this :

    Code:
    HDC hSrcDC;
    
    if ( bState )
     hSrcDC = g_DC1 ;
    else
     hSrcDC = g_DC2 ;
    I just used hSrcDC for drawing , it didnt get modified and didnt change ... just used for drawing use ..

    Want to know do i need to release it ?! ( myself, i think i dont need to )

    Regards,

  2. #2
    Join Date
    Mar 2004
    Posts
    7

    Re: Q: Copying HDC ...

    Hi,
    you don't have to relase hSrcDC, because it is only a handle and you did not make a copy of this handle. You only assigned the value to a another variable.

    Regards

  3. #3
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Q: Copying HDC ...

    You can use bitblt to copy the contents of 1 DC to another DC.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

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