I am trying to open dialog containing MS FlexGrid ActiveX control using DoModal() from an ActiveX control project(OCX). I added member variable for the FlexGrid control and generated a wrapper class for it through wizard. But the dialog is not showing up after DoModal(). I noticed that the OnInitDialog() is not getting called. The dialog appears if I remove the MS FlexGrid control from the dialog. I have no idea what did I miss.
Asked
Active
Viewed 716 times
0
-
If you remove just the control the dialog opens? – Sunscreen Sep 01 '11 at 11:25
1 Answers
0
In the same thread that creates the controls/dialogs make sure that you initialize things with the following calls before creating any of the controls/dialogs.
AfxEnableControlContainer();
CoInitialize();

Erik
- 1,674
- 3
- 15
- 18
-
Thanks Erik. Added AfxEnableControlContainer() inside InitInstance() of my activex control. It worked. – coonal Sep 02 '11 at 08:40