ActiveX control's events 
Author Message
 ActiveX control's events

Hi,

I am developing MDI application (non-MFC) and one of my child windows
displays MSFlexGrid control. I can create and display the control (using
ATL) but:

1) pressing arrow keys doesn't move the cell focus rect
2) I don't know how to get events from MSFlexGrid (I am intrested in
RowColChange event)

Here is the code I use to create the control:
-------------CODE---------------
 _hGrid = CreateWindowEx(WS_EX_CLIENTEDGE, "AtlAxWin",
"MSFlexGridLib.MSFlexGrid",
  WS_CHILD | WS_TABSTOP | WS_VISIBLE, 0, 0, 400, 400, _hwnd, (HMENU)
IDC_GRID,
  _hInstance, NULL);
-------------CODE---------------

Could anyone tell me how can I receive events in MDI child window?

Thanks

Miroslav ?ulc



Sat, 17 Apr 2004 22:40:30 GMT  
 ActiveX control's events


Quote:
> Hi,

> I am developing MDI application (non-MFC) and one of my child windows
> displays MSFlexGrid control. I can create and display the control (using
> ATL) but:

> 1) pressing arrow keys doesn't move the cell focus rect
> 2) I don't know how to get events from MSFlexGrid (I am intrested in
> RowColChange event)

> Here is the code I use to create the control:
> -------------CODE---------------
>  _hGrid = CreateWindowEx(WS_EX_CLIENTEDGE, "AtlAxWin",
> "MSFlexGridLib.MSFlexGrid",
>   WS_CHILD | WS_TABSTOP | WS_VISIBLE, 0, 0, 400, 400, _hwnd, (HMENU)
> IDC_GRID,
>   _hInstance, NULL);
> -------------CODE---------------

> Could anyone tell me how can I receive events in MDI child window?

> Thanks

> Miroslav ?ulc

This code looks very strange to me. I guess MSFlexGrid is ActiveX control
and it should be created by CoCreateInstance(Ex) , shouldn't it ?


Wed, 28 Apr 2004 23:35:00 GMT  
 ActiveX control's events
The code is fine. It uses the ATL containment window class "AtlAxWin".

Your suggestion is dangerous. ActiveX Controls cannot be simply
created via CoCreateInstance - they require hosting! Of course there's
a mechanism for creating a control and attaching it to an ATL host
window (though I don't know the details, Mr Tandetnik will probably
supply them if needed).

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:



> > Hi,

> > I am developing MDI application (non-MFC) and one of my child windows
> > displays MSFlexGrid control. I can create and display the control (using
> > ATL) but:

> > 1) pressing arrow keys doesn't move the cell focus rect
> > 2) I don't know how to get events from MSFlexGrid (I am intrested in
> > RowColChange event)

> > Here is the code I use to create the control:
> > -------------CODE---------------
> >  _hGrid = CreateWindowEx(WS_EX_CLIENTEDGE, "AtlAxWin",
> > "MSFlexGridLib.MSFlexGrid",
> >   WS_CHILD | WS_TABSTOP | WS_VISIBLE, 0, 0, 400, 400, _hwnd, (HMENU)
> > IDC_GRID,
> >   _hInstance, NULL);
> > -------------CODE---------------

> > Could anyone tell me how can I receive events in MDI child window?

> > Thanks

> > Miroslav ?ulc

> This code looks very strange to me. I guess MSFlexGrid is ActiveX control
> and it should be created by CoCreateInstance(Ex) , shouldn't it ?



Thu, 29 Apr 2004 06:08:32 GMT  
 ActiveX control's events

Quote:
> The code is fine. It uses the ATL containment window class "AtlAxWin".

> Your suggestion is dangerous. ActiveX Controls cannot be simply
> created via CoCreateInstance - they require hosting! Of course there's
> a mechanism for creating a control and attaching it to an ATL host
> window (though I don't know the details, Mr Tandetnik will probably
> supply them if needed).

Fortunately, the details are spelled out already. KB Article Q192560 "HOWTO:
Adding ATL Control Containment Support to Any Window" and Q218442 "HOWTO:
Dynamically Add ActiveX Controls to ATL Composite Control". Also note
Q229904 "PRB: CAxWindow Members Can Cause a Memory Leak".
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat, and
wrong." H.L. Mencken



Sat, 01 May 2004 02:25:44 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ActiveX control's event raising "Access Violation" error

2. Q: Fire an ActiveX control's events from another thread?

3. activex control's Worker thread and events

4. Handling ActiveX control events without an ActiveX container

5. ActiveX control 'ms grid control'

6. Controlling an event of an ActiveX control

7. Child window of ActiveX control doesn't draw when control is moved in dialog

8. Accessing Base Class's control's events

9. Control webbrowser ActiveX control in composit ActiveX control

10. ActiveX Events don't fire

11. Drag'n'drop over ActiveX control

 

 
Powered by phpBB® Forum Software