Your Ad Here at OABS!

VP lab questions...some help

Creating the controls dynamically during runtime

Make use of Create() or CreateEx() functions.Example shown below:

CRect rcClickMe; // The CRect object for this control's rectangle area

SetRect(&rcClickMe, 50,290,220,310); // This function actually sets the area

// This is the Create(...) function that actually creates the control

m_btnClickMe.Create("Click Me!", // The caption of the button.
WS_CHILD // A child window.
BS_PUSHBUTTON, // A push button style.
rcClickMe, // The position and size rectangle.
this, // The parent window.
ID_CLICKME); // The resource ID.


Now about using timer

use SetTimer() function

SetTimer(1,100000,0);
sets a timer for 100000 milliseconds or 10secs

when the timer is triggered(after 10secs),the OnTimer() message handler is invoked
perform necessay tasks there

0 comments: