Hi All,
I'm working on an ATL ActiveX component which is composed by a controller class and a
DialogBox
class. I'm trying to create the dialogbox in the controller but it doesn't work. I'll put here the interesting parts of the code.
CAxTestControl class:
class ATL_NO_VTABLE CAxTestControl :
public CComObjectRootEx<CComSingleThreadModel>,
public CStockPropImpl<CAxTestControl, IAxTestControl>,
public IPersistStreamInitImpl<CAxTestControl>,
public IOleControlImpl<CAxTestControl>,
public IOleObjectImpl<CAxTestControl>,
public IOleInPlaceActiveObjectImpl<CAxTestControl>,
public IViewObjectExImpl<CAxTestControl>,
public IOleInPlaceObjectWindowlessImpl<CAxTestControl>,
public ISupportErrorInfo,
public IConnectionPointContainerImpl<CAxTestControl>,
public CProxy_IAxTestControlEvents<CAxTestControl>,
public IPersistStorageImpl<CAxTestControl>,
public ISpecifyPropertyPagesImpl<CAxTestControl>,
public IProvideClassInfo2Impl<&CLSID_AxTestControl, &__uuidof(_IAxTestControlEvents), &LIBID_axtestLib>,
public IPropertyNotifySinkCP<CAxTestControl>,
public CComCoClass<CAxTestControl, &CLSID_AxTestControl>,
public CComControl<CAxTestControl>,
{
public:
CCAxTestDialog *m_dlg;
CAxTestControl():
m_CommandLineType(koax::koAxCommandLineTypeString)
{
m_bWindowOnly = TRUE;
}
BEGIN_MSG_MAP(CAxTestControl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
CHAIN_MSG_MAP(CComControl<CAxTestControl>)
DEFAULT_REFLECTION_HANDLER()
END_MSG_MAP()
LRESULT CAxTestControl::OnCreate(UINT , WPARAM , LPARAM , BOOL& )
{
m_dlg = new CCAxTestDialog(this);
HWND hwnd = m_dlg->Create(*this);
m_dlg->ShowWindow(SW_SHOWNORMAL);
return 0;
}
Can anyone help? What could be the problem?