Dynamically adding buttons to a view
I'm trying to construct a window which mostly contains graphics drawn
in my OnDraw() handler, but for which I'd like to have some buttons.
So, I have a CButton* u; member in the view, and in the
OnInitialUpdate function I do
u = new CButton();
u->Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), this, 0x1234567);
But no button appears. I get the impression I'm entirely
misunderstanding some bit of MFC; I've checked that I'm not drawing
over the button in my OnDraw(). I've tried calling Invalidate(), but
that doesn't help.
Re: Dynamically adding buttons to a view
The only bit that looks odd to me is your IDC. Try 25000 instead of