1. Win32Lib: getDC of a pixmap problem
Hope you're feeling better, David...
I've got a problem that probably only you can answer. I'm in the process
of wrapping up cards32.dll and making a library for creating windows card
games. I'm making great progress but I am having one minor problem. To
draw a card, the DLL requires a DC. I can draw cards to the window by
using 'getDC( Window )' to pass to the C function but if I pass a pixmap
(buffer) to 'getDC' I get an error: getDC:SelectObjct(pix) failed. (I
added the (pix) to specify that it failed when trying to get the DC of a
pixmap as opposed to a bitmap.) Does 'getDC' support getting the DC of a
pixmap in this manner or have I stumbled upon a bug here?
Thanks,
Brian
2. Re: Win32Lib: getDC of a pixmap problem
Brian Broker wrote:
> Hope you're feeling better, David...
Much, thanks.
> Does 'getDC' support getting the DC of a
> pixmap in this manner or have I stumbled upon
> a bug here?
My guess is that you failed to specify the size (x,y) of the Pixmap when you
created it. It's easy to accidentally use the (cx,cy) parameters instead:
create( class, title, parent, cx, cy, x, y, flags )
If (x,y) are zero, then no bitmap is created, and a handle of zero is
stored. Calling getDC() will then generate the error you got.
If this is the problem, either specify a size for the pixmap, or resize it
with setSize().
Hope this helps!
-- David Cuny
3. Re: Win32Lib: getDC of a pixmap problem
On Thu, 7 Oct 1999, Cuny, David wrote:
> My guess is that you failed to specify the size (x,y) of the Pixmap when you
> created it. It's easy to accidentally use the (cx,cy) parameters instead:
>
> create( class, title, parent, cx, cy, x, y, flags )
>
> If (x,y) are zero, then no bitmap is created, and a handle of zero is
> stored. Calling getDC() will then generate the error you got.
>
> If this is the problem, either specify a size for the pixmap, or resize it
> with setSize().
>
> Hope this helps!
>
> -- David Cuny
Nope, that's not it. I define my pixmap as follows:
Buffer = create( Pixmap, "", 0, 0, 0, 700, 800, 0 )
I even added a setSize in my onOpen routine (just to be sure):
setSize( Buffer, 700, 800 )
I get the same error... any other suggestions?
4. Re: Win32Lib: getDC of a pixmap problem
Brian Broker wrote:
> I get the same error... any other suggestions?
Send me the code.
-- David Cuny