for gdi leaks and useagebility..

http://www.web.ms11.net/drarem/ron2.exe
it has grown to 11k

the palette is near to working pretty good, with 'selection' bars and a blending button. the ones at top left do nothing, except for the 'pen' button on the top left which exits the app. The up and down arrows only move the selection pointers when blend is toggled.

thinking of using this for a landscape modeller, any suggestions on how it should work would be highly appreciated (by moi).
Posted on 2003-09-16 20:48:57 by drarem
Hi, drarem!
The up and down arrows only move the selection pointers when blend is toggled.

Still it seems to me that color isn't changing when I press these buttons (I suppose the color should become darker or lighter). When I manually shift each selection pointers, things are Ok.
Win2k SP4

Also, as far as I can understand, when I shift grayscale selection pointers, the color ones should move with it (just equate each color pointers to grayscale one. Or may be it shoud be better to shift color selection pointers relatively from current position)
Posted on 2003-09-16 22:47:48 by S.T.A.S.
nice job drarem ! :alright:

It work fine in win2k + spack 3! There's a little delay on drawing only if you click a single point.

I'm interested in how you do it in 11 k:). I suppose a dialog. An also, what apies did you use to draw the lines ? Is very fast !

B7
Posted on 2003-09-17 01:54:13 by Bit7
Hi drarem,

MemProof reports 14 gdi problems, without the source I can't really check any further.
        1  Error                 76010303          0  Attempt to free unexisting resource

1 Pen 633006B4 0 CreatePen(0,18,16777215)
1 Bitmap 7A0506B0 0 LoadBitmap(4194304,2001)
1 Bitmap C10506A8 0 LoadBitmap(4194304,2002)
1 Bitmap 75050680 0 LoadBitmap(4194304,2003)
1 Bitmap 340506A7 0 LoadBitmap(4194304,2004)
1 Bitmap 050506BD 0 LoadBitmap(4194304,2005)
1 Bitmap 050506BE 0 LoadBitmap(4194304,2006)
1 Bitmap 1D050632 0 CreateCompatibleBitmap(16843936,800,600)
1 Bitmap 29050530 0 CreateCompatibleBitmap(16843936,302,302)
1 Bitmap 36050678 0 CreateCompatibleBitmap(16843936,128,296)
1 DC 21010659 0 CreateCompatibleDC(16843936)
1 DC 720102B8 0 CreateCompatibleDC(16843936)
1 DC F601068F 0 CreateCompatibleDC(16843936)
1 Dialog 000701C4 0 CreateDialogParam(4194304,1000,0,00401643,0)
Posted on 2003-09-17 04:44:24 by donkey
ack.. it does have issues. I just grabbed memproof and will try to work through this myself


thanks to all for your assistance

Bit7 - I used the normal gdi stuff,
invoke MoveToEx and LineTo in the messaging (WM_MOUSEMOVE), etc.

Yes I used radasm's helper to make a dialog-based app, I would think a win32 app would be around the same size but creating controls at runtime is a pain - unless someone has made a program or addin already to convert a dlg to code in that way..
Posted on 2003-09-17 19:45:18 by drarem
the LoadBitmap(....,2001) are resource bitmaps. I thought I read somewhere on MSDN that resource bitmaps did not need to be deleted.. just like stock brushes
Posted on 2003-09-17 20:44:13 by drarem
Nope, they have to be deleted:
From MSDN LoadBitmap
The application must call the DeleteObject function to delete each bitmap handle returned by the LoadBitmap function.

Since LoadBitmap can only be used with resources I'd say the article you read was wrong:
Posted on 2003-09-17 20:52:34 by donkey
http://www.web.ms11.net/drarem/ron2.exe


now try it... still about 11k, no mem leaks as far as I can see with the memproof tool. Also fixed the updown arrows.

Update: now it's leak-free unless I am missing something, you might want to clear your internet browser cache before dowloading if you already tried it once.
Posted on 2003-09-18 07:21:46 by drarem