MFC Composites

The previous section showed you how to distribute your objects across intergalactic cyberspace, but you had to write VBScript code to tie everything on the web page together. The ATLCyberOcr ActiveX control in the last section was also pretty simple, since it had no real user interface, as it simply displayed a message. The user interface included all the controls defined in the HTML script.

That doesn’t mean you can’t build ActiveX controls with real user interfaces; in other words, a control that is composed of other controls. In this section, I will show you a quick way to develop a composite ActiveX control with a user interface. By the end of this section, you will have developed an ActiveX control similar to the one shown in Figure 8-7.

The web page that you are looking at in Figure 8-7 contains only some text and a single <object></object> tag, because the web page is dealing with only one ActiveX control. This ActiveX control has a toolbar, an image viewer, and a multi-line edit control. If you have experience with the Microsoft Foundation Classes (MFC), you may think that this ActiveX control looks much like an MFC dialog, and if that’s your guess, you are right.

MFC is a set of C++ classes that makes developing Windows applications simple. The MFC wizards in Visual C++ use portions of the MFC classes to generate frameworks for a variety of applications, including ActiveX controls. Unlike ATL, MFC supports COM using the nested classes approach, since most of ...

Get Learning DCOM now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.