Runtime control creation and event handling? 
Author Message
 Runtime control creation and event handling?


I'm using the CRdc and CMsDgridCtrl and have no problems with these when
inserted into a Dialog for a CPropertyPage.  All goes well when the
database is specified prior to building the application.

However, I cannot get the application to work when I do not specify the
database prior to building the application.

The reason I need to do this is that the user specifies the database after
application starts.

I have been able to add the controls to a CPropertyPage at runtime
using the MDIBind example as a guide.  However, as usual there is always
a catch to any Microsoft example.  The example does not show how to
capture control events.

When the controls were added in the Dialog resource editor the key items

DDX_Control(pDX, IDC_DBGRID_PROJECT, m_msdgridproject);
ON_EVENT(CPageProject, IDC_DBGRID_PROJECT, 26 /* BeforeColEdit */,
OnBeforeColEditDbgridProject, VTS_I2 VTS_I2 VTS_PI2)
ON_EVENT(CPageProject, IDC_DBGRID_PROJECT, 5 /* BeforeColUpdate */,
OnBeforeColUpdateDbgridProject, VTS_I2 VTS_PVARIANT VTS_PI2)

The problem I have is how do I now deal with the events that I would
otherwise add with the classwizard?
If someone is able to help by showing me either:
1. how to bind controls at runtime that have been entered into a dialog
using the resource editor and have no
database specified at program startup


2. how to capture events in my CPropertyPage for controls created after the
program starts.

thank you
Mark A Gregory, Senior Lecturer
Department of Communication and Electronic Engineering
Royal Melbourne Institute of Technology

Mon, 04 Sep 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Handling new events with dynamic control creation

2. Runtime creation of controls

3. ActiveX WebBrowser control creation during runtime

4. Dynamic Control Creation At Runtime?

5. How to assign an event handler to a control during runtime

6. How to handle an event fired from a control that was added dynamically

7. Handle events for dynamic created controls

8. Create ActiveX Control at runtime inside ActiveX Control, how to handle event(s)?

9. Events of Flex grid not being handled in ATL composite control

10. Handling ATL Control events in VB

11. handling activex control events

12. How can I handle the events of a control in a Miscellaneous dialog within a COM


Powered by phpBB® Forum Software