Re: Clip Region problem

"todd" <timza1221-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>



--- In [email protected], "Igor Tandetnik" <itandetnik@...> wrote:
>
> todd <timza1221@...> wrote:
> > I"m trying to restore the previous clip region after modifying it to
> > draw.  What I'm doing is crashing for some unknown reason. Any
> > suggestions or improvements? 
> > THANKS!
> > Todd.
> > 
> > 
> > void drawing(CDC odc) // parameter set by caller hdc in window
> > {
> >  CRect r(1,1,10,10);    // Example rectangle to remove from drawing
> > 
> >  CRgn m_PrevRgn;       // PROBLEM? trying to restore previous RGN
> >  odc.GetClipRgn(m_PrevRgn);   // Read it, then restore it.
> 
> I'm too lazy to check, but I suspect m_PrevRgn has NULL region handle, whereas GetClipRgn requires a valid handle (which it makes to point to a different region). Try
> 
> CRgn m_PrevRgn;
> m_PrevRgn.CreateRectRgn(0, 0, 0, 0);
> odc.GetClipRgn(m_PrevRgn);
> 
> -- 
> Igor Tandetnik
>
NO the WTL GetClipRgn() does that.  I fixed my crash (was a leak) but the code does not work, so there's still some problem there.
Thanks, Todd.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.