Looking for:
Atlwin.h download. ATL classes and structs- Atlwin.h download
Visual C++ >>atlcom.h errors
visual c++ - C++ #include is not found - Stack Overflow.Window Class Macros | Microsoft Learn
CWndClassInfo manages the information of the superclass. This technique is called superclassing. Allows you to specify the name of an existing window class on which a new window class will be based. This macro allows you to specify the class parameters of a new window class, whose information will be managed by CWndClassInfo.
Skip to main content. This browser is no longer supported. Additional resources In this article. Contains information used for rendering to various targets, such as a printer, metafile, or ActiveX control. This template is used to wrap classes that redefine the address-of operator to return something other than the address of the object. This class represents a memory-mapped file, adding a cast operator to the methods of CAtlFileMappingBase.
This class is an ATL implementation of a window that is placed on a host window provided by the Shell for Rich Preview. This class provides methods, static functions, and typedefs useful when creating collections of smart pointers. This class provides methods, static functions, and typedefs useful when creating collections of smart pointers using vector new and delete operators. This class provides methods for manipulating a window that hosts an ActiveX control and also has support for hosting licensed ActiveX controls.
This class implements IUnknown for an aggregated object. As of ATL 7. This class implements IUnknown for a tear-off interface. This class implements the IClassFactory interface. This class implements the IClassFactory2 interface.
This class implements the IClassFactory interface and allows objects to be created in multiple apartments. This class implements IUnknown by delegating to the owner object's IUnknown. This class provides the implementation for a COM enumerator interface where the items being enumerated are stored in an array.
This class provides the same methods as CComCriticalSection but doesn't provide a critical section. This class provides methods for dealing with interface pointers and the global interface table GIT.
This class provides thread-safe methods for incrementing and decrementing the value of a variable. This class provides thread-safe methods for incrementing and decrementing the value of a variable, without critical section locking or unlocking functionality. This class implements IUnknown for a nonaggregated object, but doesn't increment the module lock count in the constructor. This class provides methods to handle object reference count management for both nonaggregated and aggregated objects.
This class creates a temporary COM object and provides it with a skeletal implementation of IUnknown. This class provides methods, static functions, and typedefs useful when creating collections of COM interface pointers. This class stores IUnknown pointers and is designed to be used as a parameter to the IConnectionPointImpl template class. Finally, we need to define the window traits for our class. Window traits are a combination of window styles and extended window styles that are used when creating the window.
The styles are specified as template parameters so the caller doesn't have to be bothered with getting the styles right when it creates our window. The caller can override the styles in the CMyWindowTraits definition, but generally this is not necessary.
The ATL message map is one area that is lacking in developer-friendliness, and something that WTL greatly improves on. ClassView does at least give you the ability to add message handers, however ATL doesn't have message-specific macros and automatic parameter unpacking like MFC does. There is also a fourth parameter, bHandled. This is different than MFC, where you have to explicitly call the base-class implementation of a message handler.
This ability lets us write what are commonly called "mix-in" classes, so that we can add features to our window simply by adding classes to the inheritance list. Let's go through this new class. First, CPaintBkgnd has two template parameters: the name of the derived class that is using CPaintBkgnd , and a color to use for the background. Finally, there's the OnEraseBkgnd handler which fills in the window with the brush created in the constructor.
There are two things of note going on in OnEraseBkgnd. First, it uses the derived class's window functions namely GetClientRect. How do we know that there even is a GetClientRect in the derived class? The code wouldn't compile if there weren't! The compiler checks that the derived class T contains the methods that we call through the pT variable. Second, OnEraseBkgnd has to unpack the device context from wParam. To use this mix-in class with our window, we do two things.
First, we add it to the inheritance list:. This is called chaining message maps. This is different from MFC, where each CWnd -derived class can have only one base class, and MFC automatically passes unhandled messages to the base class. Now that we have a complete if not entirely useful main window, let's see how to use it in a program.
Here's how we start our stdafx. CComModule has explicit initialization and shutdown functions that we need to call in WinMain , so let's start with those:. The first parameter to Init is only used in COM servers. Under the hood, ATL uses some assembly-language black magic to connect the main window's handle to its corresponding CMyWindow object.
The upside of this is that there is no problem passing CWindow objects between threads, something that fails miserably with CWnd s in MFC. ATL 7 split up the module-management code into several classes.
CComModule is still present for backwards-compatibility, but code written in VC 6 that is converted by VC 7 doesn't always compile cleanly if at all so I'll cover the new class here.
In VC 7, the ATL headers automatically declare global instances of all the module classes, and the Init and Term methods are called for you, so those manual steps aren't necessary. Our stdafx. Nothing particularly exciting, I'll admit. To spice it up, we'll add an About menu item that shows a dialog. As mentioned earlier, ATL has two dialog classes. We'll use CDialogImpl for our about dialog.
No comments:
Post a Comment