Link to home
Start Free TrialLog in
Avatar of quinlan
quinlan

asked on

GDI failure/SelectObject problem

I have a problem with the win32 OWL app that I am writting.

When Codeguard is turned on, I get an error whenever I call the SelectObject parameter of a TDC.

Without Codeguard, I occassionally get program crashes and occassionally SaveDC returns 0. The crashes are always GDI failures.

I have a lot of (sometimes nested) code that looks something like this:

dc.SaveDC( );
dc.SelectObject( GetTitleFont( ) );

...

dc.RestoreFont( );
dc.RestoreDC( );

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of quinlan
quinlan

ASKER

What do you mean by "OWL's TDC classes already have the ability to save the DC state and automatically restores it afterwards."