ACTIVE TEMPLATE LIBRARY
#1

presented by:
S.UMA MAHESWARA RAO

[attachment=9673]
ACTIVE TEMPLATE LIBRARY
INTRODUCTION TO ATL

ATL is the Active Template Library, a set of template-based C++ classes with which we can easily create small, fast Component Object Model (COM) objects. using ATL, we can create efficient, flexible, lightweight controls.
Using a Template Library :
A template is similar to a macro. As with a macro, invoking a template causes it to expand (with appropriate parameter substitution) to code
we have written . template goes further than this to allow the creation
of new classes based on types that we pass as parameters. These new classes implement type-safe ways of performing the operation expressed
in your template code.
Template libraries such as ATL differ from traditional C++ class libraries in that they are typically supplied only as source code (or as source code with a little, supporting run time) and are not inherently or necessarily hierarchical in nature. Rather than deriving from a class to get the functionality you desire, you instantiate a class from a template.
The Scope of ATL :
ATL allows you to easily create COM objects, Automation server & ActiveX controls. ATL provides built-in support for many of the fundamental COM interfaces.
ATL is shipped as source code which you include in your application. ATL also makes a DLL available ( atl.dll ) , which contains code that may be shared across components. this DLL is not neceessary.
Choosing When to Use ATL
When developing components and applications, you can choose between
two approaches — ATL and MFC (the Microsoft Foundation Class Library).
Using ATL
ATL is a fast, easy way to both create a COM component in C++ and maintain a small footprint. Use ATL to create a control if you don’t need all of the built-in functionality that MFC automatically provides.
Using MFC
MFC allows you to create full applications, ActiveX controls, and active documents. If you have already created a control with MFC, we may
want to continue development in MFC. When creating a new control, consider using ATL if you don’t need all of MFC’s built-in functionality.
2.Creating ATL Project
Using the ATL COM AppWizard
To create a project using the ATL COM AppWizard
1. Open Visual C++. Click New on the File menu and click the Projects tab.
2. Choose ATL COM AppWizard as your application type.
3. Enter a project name.
4. Click OK.
The ATL COM AppWizard displays a dialog box showing options that apply to your ATL project:
• Choose from one of three server types: Dynamic Link Library (DLL) for an in-process server, Executable (EXE) for a local out-of-process server, or Service (EXE), which is a Windows NT application that runs in the background when NT starts up.
• Select the Allow merging of proxy/stub code check box as a convenience when marshaling interfaces is required. This option places the MIDL generated proxy and stub code in the same DLL as the server.
• Select the Support MFC check box (available for DLL projects only) to use MFC functionality (such as CString) in your server.
• Select the Support MTS check box to modify the project build settings to support the Microsoft Transaction Server.
Files Generated by the ATL COM AppWizard
Choose the FileView tab in the Project Workspace and expand by clicking + to see the files generated for your project:
Test.cpp Contains the implementation of your DLL’s exports for an in-process
server and the implementation of WinMain for a local server. For
a service, this additionally implements all the service managemet functions.
Test.def contains a list of your DLL’s exports. Generated only for an in-process
server.
Test.idl Includes the definitions for all your interfaces. As an Interface Definition
Language (IDL) file, it will be processed by the MIDL compiler to generate the Test.tlb type library and marshaling code.
Test.rc Contains the resource information for your project.
Resource.h The header file for the resource file.
StdAfx.cpp Includes the files StdAfx.h and Atlimpl.cpp.
StdAfx.h Includes the ATL header files.
Adding Objects and Controls
You can use the ATL Object Wizard to add an object or a control to your ATL or MFC-based projects. For each COM object or control you add, the wizard generates CPP and H files, as well as an RGS file for script-based registry support.
If you are attempting to add a simple COM object to an MFC project, you will need to add ATL support to the existing project.
To add an object or a control using the ATL Object Wizard
• With your project open, select New ATL Object from the Insert menu.
• or-
• From ClassView, click the right mouse button on the project-level folder, and select New ATL Object from the pop-up menu.
The ATL Object Wizard opens.
he ATL Object Wizard displays the categories of objects on the left and the icons of the objects in each category on the right. Choose a category; the wizard displays the icons of the objects in that category.
ATL Objects
• Simple Object adds a minimal COM object.
• Add-in Object adds a COM object that extends the Visual C++ shell with your own toolbar button and event handling. This object offers the same functionality as the one added by the DevStudio Add-in Wizard on the Visual C++ File menu, New Projects tab.
• Internet Explorer Object adds an object that supports the interfaces needed by Internet Explorer, but without support for a user interface.
• Active Server Component adds an object that can be used by the Active Server Pages feature of Internet Information Server (IIS).
• MMC SnapIn creates a framework for a Microsoft Management Console Snap-In object.
• MS Transaction Server Component includes the header files needed by the Microsoft Transaction Server and defines the object as nonaggregatable.
• Component Registrar Object adds an object that implements the IComponentRegistrar interface. This object can be used to register any objects in your in-process server that declare the DECLARE_OBJECT_DESCRIPTION macro. Using this object you can register and/or unregister objects individually, unlike DllRegisterServer and DllUnregisterServer which register and unregister all objects in your server. You may also get a list of objects in the server and their descriptions with the IComponentRegistrar::GetComponents method.
ATL Controls
• Full Control adds an object that supports the interfaces for all containers.
• Lite Control adds an object that supports the interfaces needed by Internet Explorer, including support for a user interface.
• Property Page adds an object that implements a property page.
• Composite Control adds a control that can host many other controls.
• HTML Control adds a control with DHTML functionality and displays an HTML web page in its user interface.
• Lite Composite Control adds a composite control that can host other controls, but it supports only the interfaces needed by Internet Explorer.
• Lite HTML Control adds a control with DHTML functionality and displays an HTML web page in its user interface, but it supports only the interfaces needed by Internet Explorer.
ATL Miscellaneous
Dialog adds an object that implements a dialog box.
Data Access
• Provider adds code to support OLE DB provider templates.
• Consumer adds code to support OLE DB consumer templates.
Double-click the control or object you want to insert. The ATL Object Wizard displays a dialog box showing options that apply to your object or control.
In the Names page, enter class and file names. By default, the name you enter for Short name becomes the root for all other names in this page. You can enter your own names
rather than accept these defaults.
• Class is the name of the class implementing your object.
• CoClass is the name of the component class that contains a list of interfaces supported by the object.
• Interface is the name of the interface you create for your object. This interface contains your custom methods. For Full Controls, Internet Explorer Controls, Simple Objects, Internet Explorer Objects, Add-in Objects, Active Server Components, and Microsoft Transaction Server Components, the wizard creates an interface with the name you specify. For Property Page objects, no custom interface is created, and the wizard assigns IUnknown as the object interface. Dialog objects do not create an interface.
• Type is a description string for the object that goes into the registry.
• ProgID is a name that containers can use instead of the CLSID of the object.
In the Attributes page, select a threading model, interface type, and aggregation support:
• Choose Dual Interfaces if you want the object’s interfaces to derive from IDispatch as well as support your custom functions (the vtable has custom interface functions plus late-binding IDispatch methods). This allows both COM clients and Automation controllers to access your object.
• Choose Custom Interfaces to derive the object’s interfaces from IUnKnown(the vtable has custom interface functions and not IDispatch methods). A custom interface can be faster than a dual interface, especially across process boundaries.
• Choose Only for aggregation if you want the object to be instantiated only if it is being aggregated.
• Check the Support ISupportErrorInfo check box to have your object implement the ISupportErrorInfo interface for error reporting.
• Check the Support Connection Points check box to add support for connection points to the object. The wizard will automatically derive the object’s class from IconnectionPointContainerImpl.
• Check the Free Threaded Marshaler check box to create a free-threaded marshaler object to efficiently marshal interface pointers between threads in the same process.
In the Miscellaneous page, choose the features for the object.
• Choose Opaque to make your control completely opaque, so that none of the container shows behind the control boundaries. This helps the container draw the control more quickly. The entire control rectangle passes to your control class’s OnDraw method. This option sets the VIEWSTATUS_OPAQUE bit in the VIEWSTATUS enumeration.
• Choose Solid Background to make the control’s background a solid color and not a pattern. This option is meaningful only if the Opaque is option is also selected. This option sets the VIEWSTATUS_SOLIDBKGND bit in the VIEWSTATUS enumeration.
• Choose Invisible at runtime to make your control invisible at run time. You can use invisible controls to perform operations in the background, such as firing events at timed intervals.
• Choose Acts like button to enable your control to act like a button, in particular to display itself as the default button based on the ambient property DisplayAsDefault.
• Choose Acts like label to enable your control to replace the container’s native label.
• Choose Add control based on to superclass one of the standard window classes. The drop-down list contains window class names defined by Windows. When you choose one of these, the wizard adds a CContainedWindow member variable to your control’s class. CContainedWindow::Create will superclass the window class you specify.
• Choose Normalize DC to have your control create a normalized device context when it is called to draw itself. This standardizes the control’s appearance, but is less efficient.
• Choose Insertable to have your control appear in the Insert Object dialog box of applications such as Microsoft Word and Microsoft Excel. Your control can then be inserted by any application that supports embedded objects through the Insert Object dialog box.
• Choose Windowed Only to force your control to be windowed, even in containers that support windowless objects. If you do not select this option, your control will automatically be windowless in containers that support windowless objects, and automatically be windowed in containers that do not support windowless objects.
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: ieee project report template download, project report on c languageproject status report template, download powerpoint template for biometric, sales training manual template free, powered by mybb performance review form template, free employee training plan template, training module template,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  SECURITY ON DIGITAL LIBRARY seminar class 0 1,161 02-04-2011, 12:39 PM
Last Post: seminar class
  Geospatial Data Abstraction Library(GDAL) seminar class 0 1,389 17-03-2011, 09:41 AM
Last Post: seminar class
  Active Campus Using Mobile Technology Full Download Seminar Report and Paper Presenta computer science crazy 21 9,019 14-01-2011, 10:10 AM
Last Post: seminar surveyer
  ACTIVE CAMPUS seminar surveyer 0 1,258 14-01-2011, 10:08 AM
Last Post: seminar surveyer
  Active camouflage seminar surveyer 0 921 16-10-2010, 09:30 AM
Last Post: seminar surveyer
  Two stage object tracking method based on kernel and active contour pravalika kinthada 1 2,186 06-10-2010, 03:59 PM
Last Post: project report helper
Smile RFID Library Management System Project Management Plan min_dolphin 0 3,396 07-08-2010, 06:56 AM
Last Post: min_dolphin
  Wideband Harmonic Compensation with a Voltage-Source Hybrid Active Power Filter project topics 0 1,036 01-04-2010, 03:30 PM
Last Post: project topics
  Adaptive Active Phased Array Multifunction Radars computer science crazy 1 2,697 28-12-2009, 12:50 PM
Last Post: computer science crazy
  Visual Component Library seminar projects crazy 0 1,105 13-06-2009, 05:01 PM
Last Post: seminar projects crazy

Forum Jump: