ActiveX control in C++ form based application - c++

Is it possible to use ActiveX control in C++ form based application like we use in MFC dialog based applications?

Yes, you can host an ActiveX control in WinForms using the AxHost class.

Related

How to use MFC ListCtrl in SDI

I am really a beginner with MFC. I just want a few guidelines on how to use a ListCtrl in an SDI application. For example, getting input from the user and displaying it in the listctrl when a button is clicked. Please guide me.
In SDI application I would use CListView-derived class for main view. This class has been designed to be used in SDI/MDI apps and supports standard MFC document-view architecture. The CListView class internally uses CListCtrl, but it does automatic resizing and other handy things, you can also get direct access to embedded list ctrl by calling CListView::GetListCtrl() method that returns CListCtrl*.

C++, MFC, tabbed document interface application, Win32

Is MFC only way or easiest way to craete tabbed document interface application in C++? Is there a way using plain Win32 project to create tabbed document interface application?
MFC is not deprecated.
Yes, It is much easier to use MFC to create tabbed document interface.
Please choose MFC or similar framework instead of directly dealing with UI in Win32 unless you have a very strong reason.

how to add windows form in mfc application?

i wanna know how to add windows form to the MFC application (Dialog-based) and connect it with the MFC Dialogs,so i can program with visual c++ ?
http://www.functionx.com/visualc/Lesson04.htm
I think this is what you are looking for, hope this helps.
The MFC class CWinFormsControl "provides the basic functionality for hosting of a Windows Forms control in a MFC application".
One can encapsulate more Winform standard controls in a .NET custom control (derived from the System.Windows.Forms.Control class) and then use it in the MFC app through the CWinFormsControl.
The MFC application must use the /clr flag (Common Language Runtime Support).

Can I create a ActiveX Control from a WPF UserControl and use in a non CLI C++ application?

I have created a Windows Forms UserControl that can be exposed as an ActiveX Control. Now I am trying to do the same with a WPF UserControl. The Winforms UserControl base class I noticed is ComVisible however the WPF UserControl class is not. Am I trying to do the impossible?
Is the only way to achieve this to write a WPF control and then embed it in a Winforms UserControl using ElementHost and then expose that Winforms UserControl as an ActiveX control?
Yes, I think ElementHost is the approach you will need to use if there is a chance of this working.
This is because WPF controls are inherently windowless with everything being rendered in retained mode via a DirectX surface which WPF maanges.
There are interfaces for "windowless" ActiveX controls but the COM interop provided by .NET does not map these onto WPF objects either.

Can i use CView-derived classes in an activex control?

I have developed a MFC desktop application that views building models read from an IFC(Industrial Foundation Classes) file using DirectX to render the models in a CFormView.
Now, I want to port my application to work as a Web application using ActiveX can i achieve such thing using the same structure i used in the desktop version or do i have to consider other things ?If there other things what are they ?
In other words what kind of classes i could use in desktop application and can't use it in an ActiveX control ?
This might help you: Convert simple MFC CView/CDocument/CSingleDocTemplate app to ActiveX control