Archived

This topic is now archived and is closed to further replies.

Crispy

drawing custom controls

Recommended Posts

hey, i''m currently drawing a custom control of mine every time the WM_PAINT message is sent to the window. oddly enough, if i move the control out of the desktop area and back enough times (i counted 5 - what gives?), it won''t redraw (along with any other, non-custom controls that it might happen to overlap). this doesn''t happen if i minimize the window. moreover, why are native windows controls (static fields, checkboxes, etc.) drawn after i draw my control, thus drawing over it? i want my control to be on top, at all times - how should i go about that? i''m doing this whole thing in Win32, so i''d like to stay as far away from MFC and OWL as possible thanks, crispy

Share this post


Link to post
Share on other sites
and yet another question:


class A
{
private:
void* obj[200];
int obj_counter;

public:
A() { obj_counter = 0; }

void Function(void* object);
}

class B
{
private:
int type;

public:
B(int t) { type = t; }

int GetType() { return type; }
//yadda yadda yadda
}

void SomeOtherFunction()
{
A* alpha = new A();
B* beta = new B(some_type);
alpha->Function(B);
}

void A::Function(void* object)
{
B *o = (b *)object;
if(o->GetType() = some_type)
{
//-> it all crashes here <-
(B *)obj[obj_counter++] = (B *)object;
//-> it all crashes here <-
}
}


what's wrong with this code? why does it crash when duplicating the pointer?

thanks in advance,
crispy

ps - the code is syntactically correct in reality (so any typos here are accidental)



[edited by - crispy on March 23, 2002 11:27:20 AM]

Share this post


Link to post
Share on other sites