Owner Draw problems on NT
Mike Marshall -- marshall@milner.com Tuesday, February 04, 1997 Environment: VC++ 4.2 flat, NT 4.0 I'm having problems with an owner draw list box in a dialog (actually in a property sheet.) On Wndows 95, everything works fine, but on NT 4.0, I get peculiar behavior. I know I've seen discussions about something like on this list before, but looking back through my saved messages I can't seem to find anything referring to this problem. What happens is this. I have an owner draw list box in a property page of a property sheet. I've overloaded DrawItem and MeasureItem and all that good stuff, and implemented by custom drawing. In some calls to DrawItem (not all, just some) I'm getting a strange decive context. (the lpDrawItemStruct->hDC member). So every time the function gets called, I make a call to the win32 API function GetDeviceCaps(), passing it the hDC and the TECHNOLOGY flag. I expected to get DT_RASDISPLAY as the return value every time, since I'm displaying to the screen (simple enough), but to my surprise, sometimes I get DT_PLOTTER back. Now, I have no plotter devices attached to my system, and this is totally throwing me for a loop. And like I said, this doesn't happen under Win95. The crux of my problem is that I'm trying to create a compatible DC, and you cannot create a compatible DC from a DC that has DT_PLOTTER technology. Has anyone seen this behavior before? I know I've seen posts on this, but I've scoured the newsgroups and MSDN and can't seem to find any references to it. Help appreciated, Mike
Vijaya Kumar Eluri -- vijay@vedika.co.in Friday, February 07, 1997 > From: Mike Marshall> To: "'MFC Listserv'" > Subject: Owner Draw problems on NT > Environment: VC++ 4.2 flat, NT 4.0 > > I'm having problems with an owner draw list box in a dialog (actually in a > property sheet.) > > On Wndows 95, everything works fine, but on NT 4.0, I get peculiar behavior. > I know I've seen discussions about something like on this list before, but looking > back through my saved messages I can't seem to find anything referring to this > problem. > > What happens is this. I have an owner draw list box in a property page of a property > sheet. I've overloaded DrawItem and MeasureItem and all that good stuff, and > implemented by custom drawing. > > In some calls to DrawItem (not all, just some) I'm getting a strange decive context. > (the lpDrawItemStruct->hDC member). So every time the function gets called, > I make a call to the win32 API function GetDeviceCaps(), passing it the hDC and > the TECHNOLOGY flag. I expected to get DT_RASDISPLAY as the return value > every time, since I'm displaying to the screen (simple enough), but to my surprise, > sometimes I get DT_PLOTTER back. Now, I have no plotter devices attached > to my system, and this is totally throwing me for a loop. And like I said, this doesn't > happen under Win95. I am also using something similar to what you are doing, but I don't have any problem on Wndows 95, and on NT 4.0. In both environments I am getting DT_RASDISPLAY as expected till now. I tested this using MSVC++ 4.2 and 4.1, but could not find any problem. -Vijay __________________________________________________ Eluri Vijaya Kumar, Vedika International Pvt Ltd, 21 Lansdowne Court, 5B Sarat Bose Road, Calcutta - 700 020. West Bengal, India. Tel : +91-33-2473810. Fax : +91-33-2479474. email: vijay@vedika.co.in __________________________________________________
Become an MFC-L member | Вернуться в корень Архива |