
Where is my dynamically created button?????
That is because your 'CButton MyButton' is local to OnInitDialog()
function and goes out of scope and gets destroyed once OnInitDialog() exits.
Try adding it as a member variable of your class
CButton MyButton;
instead of declaring it locally.
--
Cheers
Check Abdoul
----------------
Quote:
> Hi there,
> I have a dialog application which opens another dialog. The other dialog
> creates it'S buttons dynamically.
> I tried in the OnInitDialog() - method:
> CButton MyButton;
> CRect rect;
> rect.SetRect(100,100,150,175);
> MyButton.Create ("count",WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, rect,
> this, 10000);
> Why doesn't that work. I don't get any error, but I don't see the button
> either if the dialog is opened.
> Thx
> Yomar