Perhaps as part of an intranet project, you could choose Lite Control and save a If you know for certain that this control will be used only in Internet Explorer, The choices in the list box on the left include Full Control, Lite Control, and Property You can add several kinds of ATL objects to your project, but at the moment youĪre interested only in controls, so select Controls in the list box on the left. This opens the ATL Object Wizard,ĪTL choices are summarized before you create the project. First, you have to follow the instructions included in the Step 1 dialog boxĪnd insert an ATL object into the project.Ĭhoose Insert, New ATL Object from the menu bar. The ATL COM AppWizard created 13 files, but you don't have a skeleton control The New Project Information dialog box, shown in Figure 21.3, confirms the choices Rather than OCX, as it was for MFC controls, but that's not an important difference. MTS support-are the right ones for this project. The default choices-DLL control, no merging proxy/stub code, no MFC support, no There is only one step in the ATL COM AppWizard, and it is shown in Figure 21.2. Process you will be inserting a control into the project-that control will be calledĭieRoll, so to avoid name conflicts, choose a longer name for the project. NOTE: It's tempting to name the project DieRoll, but later in this The project DieRollControl, as shown in Figure 21.1. Fill in an appropriate directory and name As always, choose File, New andĬlick the Projects tab on the New dialog. Much simpler than it would be without the wizard. There's an AppWizard that knows how to make ATL controls, and it makes your job With a few tricks, you could reduce it toĥ0KB of control and 20KB for the ATL DLL-one-tenth the size of the total control The ATL control built in this chapter is, at How much download time can you save? The MFC control from Chapter 20 is nearlyģ0KB plus, of course, the MFC DLLs. Many MFC member functions are merely wrappers MFC classes, such as CWnd and CDC, you will recognize a lot of these SDK functions,Įven if you've never seen them before. The good news is that if you're familiar with major The Win32 SDK is a lot to learn and won't beįully covered in this chapter. To call Win32 SDK functions, just as C programmers did when writing for Windows in The alternative to MFC is to obtain the ActiveX functionality from the ATL and The delay while 600KB or so of CAB file downloads will be significant. Of your control need the MFC DLLs, and if those DLLs aren't on their system already, Your control can use all sorts of handy MFC classes, such as CString and CWnd, canĭraw itself by using CDC member functions, and more. ![]() You can get by without knowing what a COM interface is or how to use a type library. You will learn the important COM/ActiveX concepts that were skimmed over while youīuilding an ActiveX Control with MFC is simple, as you saw in Chapters 17 andĢ0. ![]() This chapter rewrites the DierollĬontrol of Chapter 17, "Building an ActiveX Control," and Chapter 20, "BuildingĪn Internet ActiveX Control," by using ATL rather than MFC as in those chapters. Using ATL is not for the timid,īut it pays dividends in smaller, tighter controls. MFC protects you from a lot of low-level COM concepts. Writing an ActiveX control with ATL requiresĪ lot more knowledge of COM and interfaces than writing an MFC ActiveX control, because ![]() The Microsoft Foundation Classes, at all. ![]() These small controls generally don't use MFC, The Active Template Library (ATL) is a collection of C++ class templates that Preparing the Control for Use in Design Mode.Registering as init Safe and script Safe.Implementing the IConnectionPoint Interface.Connecting the Property Page to CDieRoll.Special Edition Using Visual C++ 6 - Ch 21 - The Active Template Library
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |