Issue on adding ActiveX Controls in MFC CPropertySheet (Windows 7 64 bit and Windows 2008 Server)

348 views Asked by At

I have a MFC application with CPropertPage and CPropertySheet. The PropertyPages are added into CPropertySheet at runtime.

I have added VB ActiveX UserControls (Which are created in VB 6.0) into PropertyPage at design time. This application is working fine in Windows XP and the UserControls are getting loaded properly.

This same application has issue to load the UserControls in Windows 7 64 bit and Windows 2008 server.

If I remove UserControls and add MFC Controls in PropertyPage, MFC Controls are getting loaded properly.

Note:

I have tried adding VB User Controls in MFC ActiveX Container control. In this case UserControls are loading properly.

Is there any issue on using UserControls with PropertySheet/PropertyPage in Windows 7 or Windows 2008 server?

1

There are 1 answers

0
srajeshnkl On BEST ANSWER

Try to create VB Controls with "Apartment Threaded" threading model.

You can choose Threading model in Project --> Properties --> General Tab --> Threading model --> "Apartment Threaded".