-1

I have made an ATL control (ActiveX) and I can display it easily in MFC CDialog. Now I need to display it in CView of MFC single document project by using the code (just like the picture below). Don't use CForm because my customer don't need it. They need exactly Control display in CView by code.

Are there any tutorial or suggestion for this task?

enter image description here

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • Rather the contrary. If you want a view that hosts an ActiveX control, then a `CFormView` is exactly what you need. Yes, `CFormView` is normal code, so you *could* write your own form type that does the same things, but avoiding such things is exactly why you use a framework. – Jerry Coffin Jul 13 '22 at 06:03

1 Answers1

0

The MFC CView class doesn't directly support hosting of Win32 or ActiveX controls on its surface. That functionality is built into the CFormView class. If you want to readily host controls on your view, you should be using CFormView.

Ed Dore
  • 2,013
  • 1
  • 10
  • 8