There are two ways to create a common control. You can instantiate the
corresponding MFC control class and call the resulting object’s Create()
function. Or we can add a control resource line to the dialog resource script
directly.
As an example see the code below, which will attach a progress control directly
to a window:
#include <afxcmn.h>
. . .
. . .
CProgressCtrl ctrlProgress;
CRect ctrlLoc(12, 20, 48, 18);
ctrlProgress.Create(WS_CHILD | WS_VISIBLE | WS_BORDER, ctrlLocation, this,
IDC_PROGRESS);
|