// IDC_MSACALCTRL1 is the ID of the Calendar control OCX embedded // on this dialog. CWnd *pWndCal = GetDlgItem(IDC_MSACALCTRL1); // Use the IUnknown of the control. LPUNKNOWN pUnk = pWndCal->GetControlUnknown(); // From there get the IDispatch interface of control. LPDISPATCH pDisp = NULL; pUnk->QueryInterface(IID_IDispatch, (LPVOID*)&pDisp);
// on this dialog.
CWnd *pWndCal = GetDlgItem(IDC_MSACALCTRL1); // Use the IUnknown of the control.
LPUNKNOWN pUnk = pWndCal->GetControlUnknown(); // From there get the IDispatch interface of control.
LPDISPATCH pDisp = NULL;
pUnk->QueryInterface(IID_IDispatch, (LPVOID*)&pDisp);