🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #2356

Create-In-CompatibleDC?

#2356
From: mms00786
Date: Tue, 08 May 1990 18:31
37 lines
2363 bytes
I have a probably trivial question. I need to do the following:
     1) Register a Window Class with the CS_OWNDC style.
     2) Set the mapping mode etc during the WM_CREATE processing.

     3) Then, on a timer event, I want to create a compatibleDC, select a
        compatible bitmap into it, do some drawing, bitblt to the real DC
        and get out.

What I find is that when I call CreateCompatibleDC(hDC), the memory device
context does not have any of the mapping mode information at all! The memory
device context returns essentially a DC with the default settings! The end
result is that I still have to set mapping mode etc on every timer event.
So, what am I doing wrong? Of course, I have checked and double checked that
hDC passed to createcompatibledc is the correct one, and still has the mapping
info etc (verified by directly drawing to hDC).

Secondly, if I am able to create a compatible bitmap and keep the returned
handle around for the life of the program instance, why is it that I am not
allowed to create a compatible DC and keep it around? I think you can't do this
because if I try, my program dies.

In essence, I have to draw on a bitmap and do a bitblt on a timer event. Given
this, I want to minimize processing during WM_TIMER. Ideally, I would have the
DC etc already setup. So how can I do this? Assuming that I can't keep a DC
around for very long, why won't CreateCompatibleDC create a compatible DC?

BTW, I called Microsloth, and the person who answered told me that there is not
support anymore for the SDK tech questions except through Online. Moreover, he
said I cannot (repeat cannot) even write a letter to tech support and expect a
reply at their leisure! Well, I guess my check for the SDK must have cleared,
eh? End of transaction. So, I turn to the collective expertise of net-x-perts!
Please help.

Thanks,

Milan.
Technical Details
Message-ID: <118500015@uxa.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!mms00786

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!mms00786
From: mms00786@uxa.cso.uiuc.edu
Newsgroups: comp.windows.ms
Subject: Create-In-CompatibleDC?
Message-ID: <118500015@uxa.cso.uiuc.edu>
Date: 8 May 90 18:31:00 GMT
Lines: 37
Nf-ID: #N:uxa.cso.uiuc.edu:118500015:000:1867
Nf-From: uxa.cso.uiuc.edu!mms00786    May  8 13:31:00 1990