I am developing an ActiveX Control for a MFC app.
In this app I have a controle class:
class MyControl : public COleControl
and a CWnd class:
class MyCWnd : public CWnd
As well as other classes for the active x and an idl file...
Within the MyControl class I want to open the window MyCWnd as an MFC appartment (a thread where the window runs).
To do so I have an attribute theWnd in MyControl defined as:
MyCWnd theWnd
in a method withing MyControl I want to create the window by calling:
theWnd.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, CRect(0, 0, 0, 0), NULL, AFX_IDW_PANE_FIRST, NULL);
but this line returns false.
How should I initialize then create (start) a CWnd within a COleControl class? If it is not possible is there another class I can inherit from than COleControl for an ActiveX controle?
question from:https://stackoverflow.com/questions/65941779/cant-call-cwndcreate-from-colecontrol-c