Can I have multiple controls in an ActiveX project / DLL? - visual-c++

I have an OCX (DLL) developed in Visual Basic 6.0. This OCX has several controls within the project, and I
am converting or translating that OCX to Visual C++ 2012.
So far I can create a MFC ActiveX project with the
wizard and it works, but I have not found a way to add a different controls to the same OCX ,
so I do not know if that is even possible in Visual C++ 2012, because I want to have a single ActiveX OCX / DLL
with all the controls inside as the OCX is to maintain compatibility cause I want to replace the
OCX with a new version.

You will find what you are looking for in the Project menu -> Add Class...

You can create a dialog in your ActiveX control and put multiple controls on the dialog, just like any other dialog. If you don't want it to look like a dialog then turn off the titlebar and border styles on the dialog template. This will give you a child window that the user cannot move and it should blend in visually with the parent window.

Related

Visual MDI Tabs part of which class

I habe a Visual MFC MultiDoc application. I want to get an ON_WM_RBUTTONDOWN message if I click on the tab. I assumed that this part of the CMDIChildWndEx class. But I don't get any message if I click the tab. So I guess it must be another class.

Why is CTabCtrl background white, not the colour of the dialog

Within Visual Studio 2017 I created an MFC dialog-based application from scratch. In the dialog editor I dropped a Tab Control on then used Add Variable... to create a data member of type CTabCtrl and added a couple of lines in OnInitDialog() to create some empty tabs. The result is here:
When I add content (dialogs) to the tabs, and the dialogs are smaller than the tab control, the white background looks especially ugly.
If I do the same in Visual Studio 2008 the background is grey, like the dialog.
My questions are:
Why did this change from VS2008 to VS2017?
What can I do simply to make the background the same as the dialog? My current fix is to derive from CTabCtrl, and handle WM_ERASEBKGND and WM_PAINT (as mentioned here) which is much more code than I want to support.

Show active windows/forms open in a menu in Visual Foxpro 9

Working in Visual Foxpro 9, I've been trying to set a menu in wich all running forms are shown in a menu, in a style of the menu "Window" of Foxpro itself.
Using the Menu Designer Wizard, I've been able, so far, to add a "Cycle" item by inserting a menu bar with the option set to "_mwi_rotat"
Is there any way to accomplish this feature? I've been googling it to no avail.
Thanks in advance.
Just include the built-in Window pad in the menu. That's easy to do if you create your menu with the Menu Designer and start with a quick menu. Then just remove what you don't want and add what you do, but leave the Window pad and the Cycle item.

Create DUPLICATE code window in visual studio 2012

I want one code window to have two duplicates. I want to place one code window on one monitor, and second code window on the second, extended monitor.
As I Go on typing, I want second window to display the code that I type on the first monitor. Is it possible in visual studio 2012?
It would be very helpful for me while teaching the trainees.
I haven't got a copy installed here to test but I believe the answer you're looking for lies hidden under the Window menu..
Activate the window you wish to duplicate and under Window on the toolbar choose New Window. This will create a duplicate of the active document. Under the Window menu again you should find the option to make the window Floating
Update for Visual Studio 2013: Vertical split of cshtml window in VS2013
In VS2012, the feature closest to what you are after is called "Split" and its under the Window menu when you have a code file selected. This creates a split view of the selected code file within the original window.
I don't know of any way to seperate the copies from each other and float them on different screens.

how to add a custom mfc control to the dialog window?

I've derived a class from CStatic in MFC. But I don't know how to add it to my dialog window.
This mfc application that I'm working on is a dialog based application.
In Gtk+ or Qt we could use layouts and add our widgets to them, but in mfc it doesn't seem to be such a mechanism. I'm wondering how is it possible for an custom made control to be added to another GUI element!!!
Please give me a simple example if you can.
thank you
I think the technique you are looking for is subclassing (MSDN).
There is a good sample on that page too.

Resources