Click to See Complete Forum and Search --> : MFC, dynamically create a windows control


sayoyo
May 4th, 1999, 03:44 PM
Hi, Im a beginner of MFC(and programmation), Can someone tell me how to create dynamically a window control (like a editbox, or a Button) without using a .rc file. Thanks

May 5th, 1999, 08:42 AM
Something along these lines

CButton *pNewButton;

pNewButton = new CButton;

pNewButton->Create( ... ); // insert needed parameters in place of ...

I would recommend making the pNewButton a private member variable of the class you create it in so you may access it later.