I'm writing my first Direct show filter, and everything works fine except when I try to create the custom properties page for the filter.
I would like to create one checkbox control foreach output pin available in the filter.
HRESULT CActivateDeliveryProp::OnActivate(void)
{
...
CWnd * pMyWindow;
pMyWindow = CWnd::FromHandle(this->m_hwnd); // or may (this->m_Dlg); ??
...
CButton *chkOutputPin;
chkOutputPin = new CButton;
chkOutputPin->Create(_T("&my check")
, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX
, CRect(10, iTopPosition, 140, 35),pMyWindow, 0x11);
}
- Is this the correct way to get the handle to the parent dialog?
Update:
Sorry, I didn't express my real problem well, I only wrote a part of my problem. I don't have problem getting main parent form.
My problem is when I try to add a new CheckBox control I get this assertion and code doesn't work.
Thanks for all!