Re: windoze printing

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ad wrote:

> But it is certainly not forbidden to 'help' Mr. Cuny.
> If we think we found something that is not yet in Win32Lib,
> cannot we experiment with it?

By all means, please do so!


> And besides that, code provided by Jacques Dechenes is not
> that bad, IMO.

I've given serious thought to gutting my own code in Win32Lib and
replacing it with Jacques'. He is certainly much better at coding
this Win32 stuff than I am. But right now, it's just too much effort.


> So if we add some functionality because we need it or just by
> experimenting, we should provide our own include files, that
> maybe later can be implemented in Win32Lib, when it's Davids time
> to do that.

And if I can just include your code without changing Win32Lib, so much
the better. I'll be glad to give credit where credit is due.

Adding routines that wrap simple API calls is fairly easy. Just convert the
window id into a handle with getHandle.

Graphics are only a bit more complex. Look at drawRectangle() for a
typical graphic API wrapper. Here's the deal:

1. Use getDC() and releaseDC() to grab the DC of what you want to read
   and write to. Typically, this is done within the context of an onPaint
   call, and the DC has already been grabbed. These routines take care
   of the details.

2. If you need to draw with a pen, be sure to call createPen() before you
   make the API call. This creates a pen using the attributes assigned in
   setPenColor() and setPenStyle().

3. If you need to call SelectObject for a GDI resource , use replaceObject()

   instead. This is my "garbage collection" routine for GDI resources, to
   prevent memory leaks.

   Calling replaceObject automatically releases the prior resource (if it
   is not a stock object), and releases the selected object at the end of
   the onPaint call, or at the end of the program.


> But in the mean time I think I have the right to experiment in
> Windhoos programming, and I think everyone willing to should claim
> that right.

Yes!


> Does any1 of know the 'Envelop Engine' programming language?

I downloaded it once, but never actually tried it. The project has been
officially been abandoned, which is a pity. A free alternative to VB, but
the size was a bit much.

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu