Click to See Complete Forum and Search --> : ActiveX Wrapper Help


Kevin Gregg
September 27th, 1999, 11:28 AM
I am using an activex control (Protoview datagrid) in my application. I have created 2 classes which derive from it like this :

Protoview Wrapper Class->DerivedClassA->DerivedClassB

where DerivedClassA is being used to handle all GUI-related stuff and DerivedClassB will handle all the DB stuff. When creating member vars, I am using DerivedClassB. The control has some events which when mapped, are placed in a BEGIN_EVENTSINK_MAP section. Normally, these would be placed in the dialog cpp file or wherever the datatable is located. What I would like to do, is place this sink in the DerivedClassA class as the events are all GUI-related and I want them to occur for every datatable.

Here is my sinkmap :

BEGIN_EVENTSINK_MAP(CDerivedClassA, ProtoviewWrapperClass)
//{{AFX_EVENTSINK_MAP(CDerivedClassA)
ON_EVENT(CDerivedClassA, IDC_DATATABLEDB1, 51 /* LfDblClick */, OnLfDblClickDatatable, VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_PI4)
ON_EVENT(CDerivedClassA, IDC_DATATABLEDB1, 50 /* LfClick */, OnLfClickDatatable1, VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_PI4)
ON_EVENT(CDerivedClassA, IDC_DATATABLEDB1, 29 /* RowSel */, OnRowSelDatatable1, VTS_I4)
ON_EVENT(CDerivedClassA, IDC_DATATABLEDB1, 60 /* DTGotFocus */, OnDTGotFocusDatatable1, VTS_NONE)
ON_EVENT(CDerivedClassA, IDC_DATATABLEDB1, 64 /* BeforeExpand */, OnBeforeExpandDatatable1, VTS_I4 VTS_PI4)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

Because the 2nd param is the actual ID of the datatable, how can I accomplish this? Since the event maps are static, I cannot access the object members. Any help is appreciated!

Kevin