ATL for Windows CE Overview

The Active Template Library (ATL) for Windows CE is a specially designed C++ template library optimized to help you create small, fast, ActiveX servers. It provides stock implementations of many of the most commonly used interfaces. It also supports dual interfaces, aggregation, connection points, enumerators, tear-off interfaces, and ActiveX controls (including the new windowless controls).

An ActiveX server is a dynamic link library (DLL) or executable (EXE) that contains one or more COM components. These components can be anything from a simple object, dialog box, or property sheet to a full ActiveX control, with or without Internet browser support. In addition to the components themselves, a server provides the class factories that instantiate the components when requested by clients. The server also contains code to register and unregister itself, and to let COM know when it can safely be unloaded from memory.

ATL for Windows CE is expressly designed for creating ActiveX controls and other COM components, so your ATL components only implement the specific interfaces your project requires. Because of this, the code you create using ATL is smaller, faster, and more efficient than the code you would create by using MFC for an equivalent project. To get the most benefit from using ATL, however, you do need to have some familiarity with the Component Object Model (COM).

For more information about how the Active Template Library for Windows CE can help make it easier to develop ActiveX components and controls, see Using a Template Library and Using the ATL for Windows CE Wizards to Simplify Application Development.

For information on differences between ATL for Windows CE and ATL for desktop platforms, see How is ATL for Windows CE Different from ATL for Desktop Platforms?


Using a Template Library

A template library is just like any other C++ class library, except that most of the classes in it are template classes.

A template class is like a family of classes that provide the same basic functionality, but operate on mulitple data types. Instead of defining a separate class for each data type, however, you define one class that has one or more formal type parameters. When you instantiate the class, you pass the appropriate data types as the actual parameters. The compiler then expands the class definition, substituting the actual type parameters for the formal type parameters used in the template specification. In this way, template classes provide the benefits of polymorphism without the overhead of traversing a class hierarchy.

By using template classes wherever possible, ATL for Windows CE is able to create smaller, faster components than it could by using inheritance alone, as MFC does. Another difference between ATL and MFC is that ATL makes use of multiple inheritance. Multiple inheritance can be tricky to implement but, when used properly, it provides a way to reuse existing classes more efficiently than you could by using single inheritance alone.

By judiciously combining the advantages of multiple inheritance with the benefits of template classes, ATL for Windows CE helps you create the smallest, fastest, and most efficient COM components and ActiveX controls possible.

You generally include the ATL for Windows CE source code directly in your application, but you can also use it as a shared DLL by linking your application with Atlce.dll.


Using the ATL for Windows CE Wizards to Simplify Application Development

The Windows CE Toolkit for Visual C++ 5.0 provides two wizards for the Active Template Library for Windows CE. These are the WCE ATL COM AppWizard and the WCE ATL Object Wizard.

You use the WCE ATL COM AppWizard to create a new ATL project. Like the WCE MFC AppWizard, the WCE ATL COM AppWizard generates some of the generic code that's common to all ATL projects. It provides five global functions and a globally declared instance of CComModule.

The DllMain function is the dynamic link library (DLL) equivalent of WinMain. The DllRegisterServer and DllUnregisterServer functions register and unregister the server's components in the registry. Clients can call the DllGetClassObject function to obtain a pointer to the class factory for any component defined in the DLL. COM calls the DllCanUnloadNow function to determine when all objects managed by the DLL have a reference count of zero, so it can unload the DLL from memory. The CComModule object maintains information about all the objects managed by the server. There must be exactly one instance of CComModule in every ATL project.

The project generated by the WCE ATL COM AppWizard initially contains no COM components. After the project is created, you can use the Windows CE ATL Object Wizard to add components to it. The Windows CE ATL Object Wizard supports seven basic types of components. The components are derived from various templatized classes that provide default implementations of commonly used COM interfaces. The Windows CE ATL Object Wizard generates the necessary header file declarations, IDL definitions, and COM interface map entries for the components you add. You write the methods that implement the functionality that's specific to your components. You can also override the implementations of standard interface methods inherited from the ATL classes.


What types of components does the Windows CE ATL Object Wizard support?

The Windows CE ATL Object Wizard can help you create the following types of components.

Simple objects initially implement only the IUnknown and, optionally, the IDispatch, ISupportErrorInfo, and IConnectionPointContainer interfaces. You can add other interfaces after inserting the simple object into your project, but you must provide the implementation for those methods yourself.

Internet Explorer objects implement all the interfaces implemented by simple objects. They also implement the IObjectWithSite interface, which is required for objects used in web pages. These objects are compatible with the Windows CE Pocket Internet Explorer as well as the Internet Explorer for desktop platforms.

Internet Explorer controls implement all the interfaces implemented by Internet Explorer objects. They also implement the IPersistStreamInit, IOleControl, IOleObject, IOleInPlaceActiveObject, and IViewObjectEx interfaces and, optionally, the IOleInPlaceObjectWindowless interface. Controls also inherit from the ATL CComControl class, which provides a number of helper functions that are necessary for controls. These controls are compatible with the Windows CE Pocket Internet Explorer as well as the Internet Explorer for desktop platforms.

Full controls implement all the interfaces implemented by Internet Explorer controls, except for IObjectWithSite. They also implement the IProvideClassInfo2, IPersistStorage, IQuickActivate, IDataObject, and ISpecifyPropertyPages interfaces.

You can also use the Windows CE ATL Object Wizard to create dialog boxes, property pages, and a component registrar for your server. A component registrar is an object that can register and unregister individual components in a DLL.


How is ATL for Windows CE Different from ATL for Desktop Platforms?

The Active Template Library for Windows CE supports most of the features supported by the Active Template Library for desktop Windows platforms. The most significant difference is that ATL for Windows CE only supports the creation of in-process servers. You can't use it to create executables or Windows services.

An in-process server is a DLL that is loaded directly into the address space of the calling process. An out-of-process server is a stand-alone executable that runs in its own address space. Because an in-process server runs in the same address space as its host, it doesn't incur the overhead associated with cross-process marshalling on every call.

Windows CE doesn't support the apartment threading model because it requires more memory resources than the single threading and free threading models, and this conflicts with the memory constraints on many Windows CE-based devices. Part of the overhead of the apartment threading model is its built in marshalling support, which is only necessary when making calls across process boundaries. Because Windows CE only supports in-process servers, it can save both memory and performance overhead by supporting only the single and free threading models.

There are six ATL classes that are supported on desktop Windows platforms that ATL for Windows CE doesn't support. ATL for Windows CE doesn't implement the CComApartment, CComAutoThreadModule, CComClassFactoryAutoThread, or CComSimpleThreadAllocator classes because Windows CE doesn't support the apartment threading model.

Windows CE also doesn't support asynchronous monikers, so ATL for Windows CE doesn't implement the IBindStatusCallbackImpl or CBindStatusCallback classes.

There are also some specific methods in otherwise supported classes that are not implemented in ATL for Windows CE because they relate to features that Windows CE doesn't support. See the following topics for discussions of how these differences affect the way you program in ATL for Windows CE:

Using ATL Global Functions and Macros in Windows CE

Using ATL Classes in Windows CE

What's Different in ATL for Windows CE


Using ATL Global Functions and Macros in Windows CE

ATL for Windows CE supports most of the standard ATL global functions but there are a few that aren't relevant to the current implementation of Windows CE.

In Windows CE, you can only use ATL to create in-process servers. Because you can't use it to create executables, ATL for Windows CE doesn't support the RegisterClassObject and RevokeClassObject global functions. There's no need for marshaling in an in-process server, so ATL for Windows CE also doesn't support the AtlFreeMarshalStream, AtlMarshalPtrInProc, or AtlMarshalPtrInProc global functions.

In Windows CE, whenever an application blocks, waiting for a message or some other event, the kernel puts the CPU into low power mode. If an application loops for a long time without blocking, it defeats this power management feature. Because the AtlWaitWithMessageLoop function doesn't block while waiting for the object to be signaled, ATL for Windows CE doesn't support this function.

ATL for Windows CE 2.0 also doesn't support the AtlCreateTargetDC global function. In Windows CE, this function just returns the same device context handle you pass to it.

ATL for Windows CE supports all the macros defined in the standard Active Template Library exactly the same way they're supported on the desktop Windows platforms, except for one. It doesn't support the DECLARE_CLASSFACTORY_AUTOTHREAD macro because Windows CE doesn't support the apartment threading model.

See ATL Macros and Global Functions in the standard ATL documentation for specific information about all the ATL global functions and macros.


Using ATL Classes in Windows CE

You use ATL classes in Windows CE the same way you use them on other Windows platforms. Windows CE supports all but six of the standard ATL classes.

Windows CE doesn't support the apartment threading model, so ATL for Windows CE doesn't implement the CComApartment, CComAutoThreadModule, CComClassFactoryAutoThread, or CComSimpleThreadAllocator classes.

Windows CE also doesn't support asynchronous monikers, so ATL for Windows CE doesn't implement the IBindStatusCallbackImpl or CBindStatusCallback classes.

There are some classes in ATL for Windows CE that don't support all the methods they do in the standard Active Template Library. See What's Different in ATL for Windows CE for information about these classes.


What's Different in ATL for Windows CE

There are a few classes in ATL for Windows CE that don't implement all the methods they do in the standard Active Template Library. This is generally because the functionality these methods support doesn't apply to Windows CE-based platforms, or isn't supported by the current version of Windows CE.

The CComControl class doesn't support the IDataObject_GetData method or the m_bDrawGetDataInHimetric data member because IDataObject_GetData requires the storage medium to be of type TYMED_MFPICT, and the current version of Windows CE doesn't support metafiles. CComControl also doesn't implement the DoVerbProperties method in Windows CE, and the CComControlBase::IOleInPlaceObject_SetObjectRects method doesn't support clipping.

The CStockPropImpl class doesn't implement the put_MouseIcon or put_Picture methods because Windows CE doesn't support the global OleLoadPicture function.

Windows CE doesn't support connections between data objects and advise sinks, so the IDataObjectImpl class doesn't implement the DAdvise, DUnadvise, or EnumDAdvise methods or the IDataObjectImpl::m_spDataAdviseHolder data member.

The IOleObjectImpl class doesn't implement the EnumVerbs, GetMiscStatus, or GetUserType methods because Windows CE doesn't support the OleRegEnumVerbs, OleRegGetMiscStatus, or OleRegGetUserType global functions.

The IPropertyPageImpl class doesn't implement the OnStyleChange method because Windows CE doesn't support the WM_ONSTYLECHANGING message. IPropertyPageImpl also doesn't support the Help method.

Windows CE doesn't support all the window styles or message box styles the desktop Windows platforms support, so there are certain style flags you can't use as arguments in the CContainedWindow::Create, CWindowImpl::Create and CWindow::MessageBox classes. See these topics for details.

In Windows CE, a user can send a window to the back of the Z-order or restore it to the foreground by tapping its icon button on the taskbar, but Windows CE doesn't support minimizing or maximizing of windows. Because of this, the CWindow class doesn't support the IsIconic, IsZoomed, ArrangeIconicWindows, GetWindowPlacement, or SetWindowPlacement methods. You can't use the SW_MAXIMIZE, SW_MINIMIZE, SW_RESTORE, SW_SHOW, SW_SHOWDEFAULT, SW_SHOWMAXIMIZED, SW_SHOWMINIMIZED, SW_SHOWMINNOACTIVE, OR SW_NOACTIVARE flags in the nCmdShow parameter to the CWindow::ShowWindow method.

WinHelp isn't available in Windows CE, so you can't use the CWindow methods GetWindowContextHelpId, SetWindowContextHelpId, and WinHelp.

ATL for Windows CE doesn't implement the CWindow class' ChangeClipboardChain and SetClipboardViewer methods, because Windows CE doesn't support clipboard viewers.

Windows CE doesn't provide support for automatically filling in a list box or combo box with filenames from a directory, so you can't use the DlgDirList, DlgDirListComboBox, DlgDirSelect, or DlgDirSelectComboBox methods of the CWindow class.

Windows CE doesn't support hot keys, so ATL for Windows CE doesn't implement the CWindow class' GetHotKey and SetHotKey methods.

Windows CE doesn't support system menus, so the CWindow class doesn't implement the GetSystemMenu method.

Scroll bars are always visible in Windows CE, so CWindow doesn't implement the EnableScrollBar or ShowScrollBar methods.

Windows CE doesn't currently support OLE drag and drop operations, so the CWindow class doesn't implement the DragAcceptFiles method.

The GetWindowWord and SetWindowWord methods are obsolete. Use CWindow::GetWindowLong and CWindow::SetWindowLong, instead.

The ScrollWindow method is also obsolete, so Windows CE only supports the more versatile CWindow::ScrollWindowEx method. You can't scroll child windows in Windows CE, so you can't pass the SW_SCROLLCHILDREN flag in the flags parameter to this method.

In ATL for Windows CE, you have to use the original CWindow::ChildWindowFromPoint and CWindow::GetDC methods instead of the newer ChildWindowFromPointEx and GetDCEx methods.

Windows CE versions 2.0 and later support printing, but ATL for Windows CE 2.0 doesn't provide support for the CWindow Print and PrintClient methods yet. Use the global functions instead.

Windows CE supports some of the dialog box methods slightly differently than the desktop Windows platforms do. The CWindow::GetDlgItem method doesn't search through nested dialog boxes, the CWindow::GetDlgItemInt method only translates text strings of up to 48 characters, and the CWindow::SetDlgItemInt method treats all values passed to it as signed.

Windows CE only supports solid carets, so you can't use the hBitmap parameter in the CWindow::CreateCaret method.

In Windows CE, you can only set the keyboard focus to a window associated with a different thread's message queue if one window is the parent of the other, or if the windows are siblings of the same parent. See CWindow::SetFocus for more information.

Windows CE also doesn't support the FlashWindow, GetDescendantWindow, GetLastActivePopup, GetMenu, GetTopWindow, HiliteMenuItem, InvalidateRgn, LockWindowUpdate, RedrawWindow, SendMessageToDescendants, SetMenu, ShowOwnedPopups, or ValidateRgn methods of the CWindow class because the global functions they wrap aren't supported in Windows CE.

In ATL for Windows CE, the CWndClassInfo::m_wc data member maintains window class information in a WNDCLASS structure, because Windows CE doesn't support the WNDCLASSEX type.


ATL for Windows CE Samples

The following sample applications demonstrate how you can use ATL for Windows CE to write your own applications. You can find these sample applications in the Wce\Samples\Atl directory.

COUNT/COUNTCTN | Demonstrates how to use containment in an ATL control.
POLYGON/POLYCNTR | Demonstrates how to implement custom properties, events, and a property page for an ATL control.
SKETCH/SKETCNTR | Demonstrates how to capture mouse/stylus messages from the touch screen and use them to draw on the display.


COUNT/COUNTCTN

The COUNT sample demonstrates how to create a full control and a simple object, within the same DLL, that communicate with each other. The COUNTCTN sample is a simple dialog box application that provides a container for the CCount control.

The CCountCtnDlg dialog box class has two public variables, m_Counter, which is a CCounter object, and m_nMaxCounter which is an integer that's initialized to 10 in CCountCtnDlg's constructor.

CCounter is a full control. In addition to IUnknown and IDispatch, it implements the ICounter interface, which exposes three methods. It supports a dual interface, so you can either access the ICounter methods through IDispatch::Invoke or call them directly by way of the vtable. These methods are SetMaxCounter, StartCounting, and GetInfoFromCounter. CCounter also has one protected data member, called m_pIObject, which is a pointer to the IObject1 interface on a CObject1 object.

CObject1 is a simple object. It also supports a dual interface. In addition to IUnknown and IDispatch, it implements the IObject1 interface, which exposes three methods. These methods are Initialize, SetMax, and Start. CObject1 has two protected data members. The m_pICounter data member contains a back-pointer to the ICounter interface on the CCounter control that instantiates it. The m_nMax data member is an integer.

The CCounter constructor instantiates a CObject1 object and queries for a pointer to its IObject1 interface, which the CCounter control assigns to its m_pIObject data member. It then calls IObject1::Initialize, passing a back-pointer to itself, which the IObject1 object assigns to its m_pICounter data member.

When a user enters a number between 1 and 15 in the dialog box's edit control, the number is assigned to CCountCtnDlg::m_nMaxCounter. When the user taps the Apply button, CCountCtnDlg::OnSetMaxCounter invokes ICounter::SetMaxCounter on the CCounter control, passing the value of m_nMaxCounter as the argument. The ICounter::SetMaxCounter method invokes IObject1::SetMax on its m_pIObject member, passing along the value it was passed. IObject1::SetMax assigns this value to its m_nMax data member.

When a user taps the Start button, CCountCtnDlg::OnStart invokes ICounter::StartCounting on the CCounter control. ICounter::StartCounting invokes IObject::Start on its m_pIObject member, which loops m_nMax times. Each time through the loop, it calls ICounter::GetInfoFromCounter, using the back-pointer stored in its m_pICounter member, passing in a text string that states the number of times it's been through the loop. ICounter::GetInfoFromCounter displays the text string in its window on the dialog box.

This sample demonstrates the following keywords:

IUnknown::QueryInterface

DrawText

GetClientRect

PatBlt

Rectangle

Sleep

ReleaseDC

wsprintf

You can find the COUNT project files in the Wce\Samples\Atl\COUNT directory.

You can find the COUNTCTN project files in the Wce\Samples\Atl\COUNTCTN directory.

To build the COUNT and COUNTCTN samples, follow the procedure described in Building the Sample Applications, selecting one or more of the following project configurations.

  • WCE x86em (Desktop PC Windows CE emulation)
  • WCE x86
  • WCE PPC
  • WCE MIPS
  • WCE SH


SKETCH/SKETCNTR

The SKETCH sample demonstrates how to capture mouse/stylus messages and use them to draw on the screen. The SKETCNTR sample is a simple dialog box application that provides a container for the CSketcCtl control.

The CSKETCNTRDlg dialog box class has one public variable, m_Sketch, which is a CSketcCtl object. The dialog box also has an "Erase" button.

The CSketcCtl class implements the ISketcCtl interface in addition to the IUnknown and IDispatch interfaces. It supports a dual interface, so you can either access the ISketcCtl methods through IDispatch::Invoke or call them directly by way of the vtable. ISketcCtl exposes three methods, get_PenWidth, put_PenWidth, and Erase. The CSketcCtl class has seven data members. The left, right, top, and bottom data members contain the x an y coordinates of the lop left and bottom right corners, respectively, of the rectangle occupied by the control. These members are used for drawing and erasing the control. The bLBDown member indicates whether the stylus tip is touching the touch screen (which is equivalent to the left button being pressed on a mouse). The m_PenWidth member specifies the current width in pixels of the pen. The line member is an array of two POINT structures. The POINT at line[0] represents the coordinates for the beginning of a line, and the POINT at line[1] represents the coordinates for the end of the line.

When you touch the dialog box with the stylus, in the area occupied by the Sketch control, it sends the Sketch Control a WM_LBUTTONDOWN message. The CSketcCtl::OnLButtonDown handler sets bLBDown to TRUE, and assigns the coordinates of the stylus tip to the POINT at line[0]. When you move the stylus on the touch screen, it sends a WM_MOUSEMOVE message. The CSketcCtl::OnMouseMove handler sets the value at line[1] to the current coordinates of the stylus tip, draws a line from the point represented by line[0] to the point represented by line[1], then replaces the value at line[0] with the current value at line[1]. When you lift the stylus from the screen, it sends a WM_LBUTTONUP message. The CSketcCtl::OnLButtonUp handler sets bLBDown to FALSE. When you tap the "Erase" button on the CSKETCNTRDlg dialog box, it calls the Sketch control's ISketcCtl::Erase method, which erases the contents of the control.

The dialog box doesn't provide a way to access the ISketcCtl::get_PenWidth and ISketcCtl::put_PenWidth methods, but you could easily add features to take advantage of this functionality. These methods simply set and retrieve the value of the CSketcCtl::m_PenWidth member, which is used to set the pen width in the OnMouseMove handler.

This sample demonstrates the following keywords:

GetDC

Polyline

Rectangle

ReleaseDC

SelectObject

You can find the SKETCH project files in the Wce\Samples\Atl\SKETCH directory.

You can find the SKETCNTR project files in the Wce\Samples\Atl\SKETCNTR directory.

To build the SKETCH and SKETCNTR samples, follow the procedure described in Building the Sample Applications, selecting one or more of the following project configurations.

  • WCE x86em (Desktop PC Windows CE emulation)
  • WCE x86
  • WCE PPC
  • WCE MIPS
  • WCE SH


POLYGON/POLYCNTR

The POLYGON sample demonstrates how to implement custom properties, events, and a property page for an ATL control. The POLYCNTR sample is a simple dialog box application that provides a container for the CPolyCtl control.

The CPolyCntrDlg dialog box class has one public variable, m_Polygon, which is a CPolyCtl object.

The CPolyCtl class implements the IPolyCtl interface in addition to the IUnknown and IDispatch interfaces. It supports a dual interface, so you can either access the IPolyCtl methods through IDispatch::Invoke or call them directly by way of the vtable. IPolyCtl exposes two methods, get_Sides and put_Sides. CPolyCtl also has three data members. The m_clrFillColor member is an OLE_COLOR value that contains the color with which to draw the polygon. The m_nSides member contains the number of sides in the current polygon. The m_arrPoint member is an array of 100 POINT structures, that contains the coordinates of all the vertices of the polygon.

The CPolyCtl constructor initializes m_nSides to three, and m_clrFillColor to green. The OnDraw handler draws a black circle on a white background. Then it calculates the coordinates of the vertices of and equilateral polygon with m_nSides sides, and draws the polygon inside the circle, filling it with the color specified by the m_clrFillColor data member. When you tap the screen with the stylus, inside the control, the OnLButtonDown handler captures the coordinates at which the stylus tip touched the touch screen. If the x coordinate is greater than the y coordinate, the control fires the ClickIn event. Otherwise, it fires the ClickOut event. (Windows CE doesn't support the WM_RBUTTONDOWN message, so the OnRButtonDown handler isn't used.)

When the CPolyCntrDlg dialog box receives the ClickIn event, its OnClickInPolyCtl1 event handler uses the CPolyCtl control's dispinterface to invoke the IPolyCtl::get_Sides method, which returns the value of the control's m_nSides data member. OnClickInPolyCtl1 increments this value by one and passes the new value to the IPolyCtl::put_Sides method, again using the dispinterface. IPolyCtl::put_Sides assigns this value to the Polygon control's m_nSides member and calls CComControl::FireViewChange to notify the container that the control should be redrawn. When the CPolyCntrDlg object receives the ClickOut event, it uses the dispinterface in the same way to decrement the value of the control's m_nSides member.

The Polygon control has a property page, CPolyProp, that you can use during the design stage, when embedding this control in a container. The property page contains an edit control labeled Sides. When you enter a number in this edit control and tap the Apply button, the property page invokes IPolyCtl::put_Sides on the Polygon control, passing it the number you entered. IPolyCtl::put_Sides verifies that the number is greater than two and less than 101, and assigns it's value to CPolyCtl::m_nSides. It then fires CComControl::FireViewChange to notify the container that the control should be redrawn.

This sample demonstrates the following keywords:

CComControl::FireViewChange

CWindow::GetDlgItemInt

IPropertyPageImpl::Apply

IPropertyPageImpl::SetDirty

DeleteObject

Ellipse

GetStockObject

Polyline

SelectObject

You can find the POLYGON project files in the Wce\Samples\Atl\POLYGON directory.

You can find the POLYCNTR project files in the Wce\Samples\Atl\POLYCNTR directory.

To build the POLYGON and POLYCNTR samples, follow the procedure described in Building the Sample Applications, selecting one or more of the following project configurations.

  • WCE x86em (Desktop PC Windows CE emulation)
  • WCE x86
  • WCE PPC
  • WCE MIPS
  • WCE SH


ATL for Windows CE Reference

The ATL for Windows CE Reference contains documentation for all the Active Template Library classes supported in Windows CE 2.0.

Note Windows CE versions prior to 2.0 did not support the Active Template Library.

Each reference topic includes an At a Glance table containing the following information.

At a Glance

Header file: | Header file in which the class is defined.
Platforms: | Targeted platforms.
Windows CE versions: | Windows CE versions that include this API element.
Complete documentation: | Link to the complete documentation as originally published. Usually, this is a link to the Microsoft Platform SDK documentation.

When there is a link to original documentation, comments in the Remarks section are specific to Windows CE.

Windows CE supports almost all of the standard Active Template Library classes. Because Windows CE runs on platforms that are very different from the desktop Windows platforms, it has some different requirements. In order to meet these requirements, the designers of Windows CE have made changes to a few of the classes in the library.

For more information, see Using ATL Global Functions and Macros in Windows CE, Using ATL Classes in Windows CE, and What's Different in ATL for Windows CE.


CComAggObject

The CComAggObject class implements IUnknown for an aggregated object. This class has its own IUnknown, separate from the outer object's IUnknown, and maintains its own reference count. CComAggObject uses CComContainedObject to delegate to the outer unknown.

Syntax

template< class contained >

class CComAggObject : public IUnknown, public CComObjectRootEx< contained::_ThreadModel::ThreadModelNoCS >

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Methods, CComAggObject Data Members, CComContainedObject , CComObject, CComPolyObject, DECLARE_AGGREGATABLE, DECLARE_ONLY_AGGREGATABLE, DECLARE_NOT_AGGREGATABLE


CComAggObject Methods

Class Methods |
CComAggObject | Constructor.
FinalConstruct | Performs final initialization of m_contained.
FinalRelease | Performs final destruction of m_contained.
Iunknown Methods |
AddRef | Increments the reference count on the aggregated object.
QueryInterface | Retrieves a pointer to the requested interface.
Release | Decrements the reference count on the aggregated object.

See Also

CComAggObject Overview, CComAggObject Data Members


CComAggObject::AddRef

This method increments the reference count on the aggregated object.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Overview, CComAggObject Methods, CComAggObject::Release


CComAggObject::CComAggObject

The constructor initializes the CComContainedObject member, m_contained, and increments the module lock count. The destructor decrements the module lock count.

Syntax

CComAggObject( void* pv );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Overview, CComAggObject Methods, CComAggObject::FinalConstruct, CComAggObject::FinalRelease


CComAggObject::FinalConstruct

This method performs any final initialization on the m_contained member, and is called during the final stages of object construction.

Syntax

HRESULT FinalConstruct( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Overview, CComAggObject Methods, CComAggObject::FinalRelease, CComAggObject::Release, CComObjectRootEx::FinalConstruct


CComAggObject::FinalRelease

This method frees the m_contained member, and is called during object destruction.

Syntax

void FinalRelease( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Overview, CComAggObject Methods, CComAggObject::FinalConstruct, CComObjectRootEx::FinalRelease


CComAggObject::QueryInterface

This method retrieves a pointer to the requested interface.

Syntax

HRESULT QueryInterface( REFIID iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Overview, CComAggObject Methods


CComAggObject::Release

This method decrements the reference count on the aggregated object.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Overview, CComAggObject Methods, CComAggObject::AddRef


CComAggObject Data Members

Data Members |
m_contained | Delegates IUnknown calls to the outer unknown.

See Also

CComAggObject Overview, CComAggObject Methods


CComAggObject::m_contained

This data member is a CComContainedObject object derived from your class.

Syntax

CComContainedObject< contained > m_contained;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAggObject Overview, CComAggObject Data Members


CComAutoCriticalSection

The CComAutoCriticalSection class provides methods for obtaining and releasing ownership of a critical section object.

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAutoCriticalSection Methods, CComAutoCriticalSection Data Members, CComCriticalSection


CComAutoCriticalSection Methods

Methods |
CComAutoCriticalSection | Constructor.
Lock | Obtains ownership of the critical section object.
Unlock | Releases ownership of the critical section object.

See Also

CComAutoCriticalSection Overview, CComAutoCriticalSection Data Members


CComAutoCriticalSection::CComAutoCriticalSection

The constructor calls the Win32 function InitializeCriticalSection, which initializes the critical section object contained in the m_sec data member. The destructor calls DeleteCriticalSection, which releases all system resources used by the critical section object.

Syntax

void CComAutoCriticalSection( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

CComAutoCriticalSection::Lock

This method calls the Win32 function EnterCriticalSection, which waits until the thread can take ownership of the critical section object contained in the m_sec data member.

Syntax

void Lock( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAutoCriticalSection Overview, CComAutoCriticalSection Methods


CComAutoCriticalSection::Unlock

This method calls the Win32 function LeaveCriticalSection, which releases ownership of the critical section object contained in the m_sec data member.

Syntax

void Unlock( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAutoCriticalSection Overview, CComAutoCriticalSection Methods


CComAutoCriticalSection Data Members

Data Members |
m_sec | A CRITICAL_SECTION object.

See Also

CComAutoCriticalSection Overview, CComAutoCriticalSection Methods


CComAutoCriticalSection::m_sec

This data member contains a critical section object that is used by all CComAutoCriticalSection methods.

Syntax

CRITICAL_SECTION m_sec;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComAutoCriticalSection Overview, CComAutoCriticalSection Data Members, CComAutoCriticalSection::CComAutoCriticalSection, CComAutoCriticalSection::Lock, CComAutoCriticalSection::Unlock


CComBSTR

The CComBSTR class is a wrapper for BSTRs, length-prefixed strings.

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Methods, CComBSTR Operators, CComBSTR Data Members


CComBSTR Methods

Methods |
Append | Appends a string to m_str.
AppendBSTR | Appends a BSTR to m_str.
Attach | Attaches a BSTR to the CComBSTR object.
CComBSTR | Constructor.
Copy | Returns a copy of m_str.
Detach | Detaches m_str from the CComBSTR object.
Empty | Frees m_str.
Length | Returns the length of m_str.
ReadFromStream | Loads a BSTR object from a stream.
WriteFromStream | Saves m_str to a stream.

See Also

CComBSTR Overview, CComBSTR Operators, CComBSTR Data Members


CComBSTR::Append

This method appends either lpsz or the BSTR member of bstrSrc to m_str.

Syntax

void Append( const CComBSTR& bstrSrc );

void Append( LPCOLESTR lpsz );

void Append( LPCSTR lpsz );

void Append( LPCOLESTR lpsz, int nLen );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR::AppendBSTR, CComBSTR::operator +=


CComBSTR::AppendBSTR

This method appends the specified BSTR to m_str.

Syntax

void AppendBSTR( BSTR p );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR::Append, CComBSTR::operator +=


CComBSTR::Attach

This method attaches a BSTR to the CComBSTR object by setting the m_str member to src.

Syntax

void Attach( BSTR src );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR::Detach, CComBSTR::operator =


CComBSTR::CComBSTR

The default constructor sets the m_str member to NULL. The copy constructor sets m_str to a copy of the BSTR member of src.The other four constructors set m_str to a copy of the specified string; however, if you pass a value for nSize, then only nSize characters will be copied, followed by a terminating null character.The destructor frees the string pointed to by m_str.

Syntax

CComBSTR( );

CComBSTR( int nSize, LPCOLESTR sz = NULL );

CComBSTR( int nSize, LPCSTR sz = NULL );

CComBSTR( LPCOLESTR pSrc );

CComBSTR( LPCSTR pSrc );

CComBSTR( const CComBSTR& src );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods


CComBSTR::Copy

This method allocates and returns a copy of m_str.

Syntax

BSTR Copy( ) const;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR::operator =


CComBSTR::Detach

This method detaches m_str from the CComBSTR object and sets m_str to NULL.

Syntax

BSTR Detach( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR::Attach


CComBSTR::Empty

This method frees the m_str member.

Syntax

void Empty( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods


CComBSTR::Length

This method returns the number of characters in m_str, excluding the terminating null character.

Syntax

unsigned int Length( ) const;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods


CComBSTR::ReadFromStream

This method sets the m_str member to the BSTR contained in the specified stream.

Syntax

HRESULT ReadFromStream( IStream* pStream );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR::AppendBSTR, CComBSTR::WriteToStream , CComBSTR::operator +=,


CComBSTR::WriteToStream

This method saves the m_str member to a stream.

Syntax

HRESULT WriteToStream( IStream* pStream );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR::ReadFromStream


CComBSTR Operators

Operators |
operator BSTR | Converts a CComBSTR object to a BSTR.
Operator = | Assigns a value to m_str.
Operator += | Appends a CComBSTR to the object.
Operator & | Returns the address of m_str.
Operator ! | Returns TRUE or FALSE, depending on whether m_str is NULL.

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR Data Members


CComBSTR::operator BSTR

This operator converts a CComBSTR object to a BSTR.

Syntax

operator BSTR( ) const;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Operators


CComBSTR::operator =

This operator sets the m_str member to a copy of pSrc or to a copy of the BSTR member of src.

Syntax

CComBSTR& operator =( LPCOLESTR pSrc );

CComBSTR& operator =( LPCSTR pSrc );

CComBSTR& operator =( const CComBSTR& src );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Operators, CComBSTR::Copy


CComBSTR::operator +=

This operator appends the BSTR member of bstrSrc to m_str.

Syntax

CComBSTR& operator +=( const CComBSTR& bstrSrc );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Operators, CComBSTR::Append, CComBSTR::AppendBSTR


CComBSTR::operator &

This operator returns the address of the BSTR stored in the m_str member.

Syntax

BSTR* operator &( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Operators


CComBSTR::operator !

This operator returns true if the m_str member is NULL; otherwise, false.

Syntax

bool operator !( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Operators


CComBSTR Data Members

Data Members |
m_str | Contains the BSTR associated with the CComBSTR object.

See Also

CComBSTR Overview, CComBSTR Methods, CComBSTR Operators


CComBSTR::m_str

This data member contains the BSTR associated with the CComBSTR object.

Syntax

BSTR m_str;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComBSTR Overview, CComBSTR Data Members


CComCachedTearOffObject

The CComCachedTearOffObject class implements IUnknown for a tear-off interface.

Syntax

template <class contained>

class CComCachedTearOffObject : public IUnknown, public CComObjectRootEx< contained::_ThreadModel::ThreadModelNoCS >

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Methods, CComCachedTearOffObject Data Members, CComObjectRootEx , CComTearOffObject


CComCachedTearOffObject Methods

Methods |
AddRef | Increments the reference count for a CComCachedTearOffObject object.
CComCachedTearOffObject | Constructor.
FinalConstruct | Calls the m_contained::FinalConstruct (the tear-off class' method).
FinalRelease | Calls the m_contained::FinalRelease (the tear-off class' method).
QueryInterface | Returns a pointer to the IUnknown of the CComCachedTearOffObject object, or to the requested interface on your tear-off class (the class contained).
Release | Decrements the reference count for a CComCachedTearOffObject object and destroys it if the reference count is 0.

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Data Members


CComCachedTearOffObject::AddRef

This method increments the reference count of the CComCachedTearOffObject object by 1.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Methods, CComCachedTearOffObject::Release


CComCachedTearOffObject::CComCachedTearOffObject

This method initializes the CComContainedObject member m_contained.

Syntax

CComCachedTearOffObject( void* pv );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Methods, CComTearOffObject


CComCachedTearOffObject::FinalConstruct

This method calls m_contained::FinalConstruct to create m_contained, the CComContainedObject<contained> object used to access the interface implemented by your tear-off class.

Syntax

HRESULT FinalConstruct( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Methods, CComCachedTearOffObject::FinalRelease


CComCachedTearOffObject::FinalRelease

This method calls m_contained::FinalRelease to free m_contained, the CComContainedObject<contained> object.

Syntax

void FinalRelease( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Methods, CComCachedTearOffObject::FinalConstruct


CComCachedTearOffObject::QueryInterface

This method retrieves a pointer to the requested interface.

Syntax

HRESULT QueryInterface( REFIID iid , void** ppvObject );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Methods, CComCachedTearOffObject::AddRef, CComCachedTearOffObject::Release


CComCachedTearOffObject::Release

This method decrements the reference count by 1 and, if the reference count is 0, deletes the CComCachedTearOffObject object

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Methods, CComCachedTearOffObject::AddRef


Data Members

Data Members |
m_contained | A CComContainedObject object derived from your tear-off class (the class contained).

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Methods,


CComCachedTearOffObject::m_contained

This data member is a CComContainedObject object derived from your tear-off class. The methods m_contained inherits are used to access the tear-off interface in your tear-off class through the cached tear-off object's QueryInterface, FinalConstruct, and FinalRelease.

Syntax

CComContainedObject<contained> m_contained;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCachedTearOffObject Overview, CComCachedTearOffObject Data Members, CComTearOffObject


CComClassFactory

The CComClassFactory class implements the IClassFactory interface, which contains methods for creating an object of a particular CLSID, as well as locking the class factory in memory to allow new objects to be created more quickly.

Syntax

class CComClassFactory : public IClassFactory,

public CComObjectRootEx< CComGlobalsThreadModel >

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory Methods, CComGlobalsThreadModel , CComObjectRootEx


CComClassFactory Methods

Methods |
CreateInstance | Creates an object of the specified CLSID.
LockServer | Locks the class factory in memory.

See Also

CComClassFactory Overview


CComClassFactory::CreateInstance

This method creates an object of the specified CLSID and retrieves an interface pointer to this object.

Syntax

HRESULT CreateInstance( LPUNKNOWN pUnkOuter, REFIID riid, void** ppvObj );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory Overview, CComClassFactory Methods, CoCreateInstance, CoGetClassObject


CComClassFactory::LockServer

This method increments and decrements the module lock count by calling _Module::Lock and _Module::Unlock, respectively.

Syntax

HRESULT LockServer( BOOL fLock );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory Overview, CComClassFactory Methods, CComModule::Lock, CComModule::Unlock


CComClassFactory2

The CComClassFactory2 class implements the IClassFactory2 interface, which is an extension of IClassFactory. IClassFactory2 controls object creation through a license. A class factory executing on a licensed machine can provide a run-time license key. This license key allows an application to instantiate objects when a full machine license does not exist.

Syntax

template< class license >

class CComClassFactory2 : public CComClassFactory2Base, license

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory2 Methods, CComClassFactorySingleton, CComGlobalsThreadModel , CComObjectRootEx


CComClassFactory2 Methods

IClassFactory Methods |
CreateInstance | Creates an object of the specified CLSID.
LockServer | Locks the class factory in memory.
IClassFactory2 Methods |
CreateInstanceLic | Given a license key, creates an object of the specified CLSID.
GetLicInfo | Retrieves information describing the licensing capabilities of the class factory.
RequestLicKey | Creates and returns a license key.

See Also

CComClassFactory2 Overview


CComClassFactory2::CreateInstance

This method creates an object of the specified CLSID and retrieves an interface pointer to this object.

Syntax

HRESULT CreateInstance( LPUNKNOWN pUnkOuter, REFIID riid, void** ppvObj );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CoCreateInstance, CoGetClassObject


CComClassFactory2::CreateInstanceLic

This method is similar to CreateInstance, except that CreateInstanceLic requires a license key.

Syntax

HRESULT CreateInstanceLic( IUnknown* pUnkOuter, IUnknown* pUnkReserved, REFIID riid, BSTR bstrKey, void** ppvObject );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory2 Overview, CComClassFactory2 Methods, CoCreateInstance, CoGetClassObject


CComClassFactory2::GetLicInfo

This method fills a LICINFO structure with information that describes the class factory's licensing capabilities.

Syntax

HRESULT GetLicInfo( LICINFO* pLicInfo )

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory2 Overview, CComClassFactory2 Methods, CComClassFactory2::CreateInstanceLic, CComClassFactory2::RequestLicKey


CComClassFactory2::LockServer

This method increments and decrements the module lock count by calling _Module::Lock and _Module::Unlock, respectively. Calling LockServer allows a client to hold onto a class factory so that multiple objects can be quickly created.

Syntax

HRESULT LockServer( BOOL fLock );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory2 Overview, CComClassFactory2 Methods, CComModule::Lock, CComModule::Unlock


CComClassFactory2::RequestLicKey

This method creates and returns a license key, provided that the fRuntimeKeyAvail member of the LICINFO structure is TRUE.

Syntax

HRESULT RequestLicKey( DWORD dwReserved, BSTR* pbstrKey );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactory2 Overview, CComClassFactory2 Methods, CComClassFactory2::GetLicInfo


CComClassFactorySingleton

The CComClassFactorySingleton class derives from CComClassFactory and uses CComObjectGlobal to construct a single object.

Syntax

template< class T >

class CComClassFactorySingleton : public CComClassFactory

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactorySingleton Methods, CComClassFactorySingleton Data Members, CComClassFactory , CComClassFactory2, CComGlobalsThreadModel, CComObjectGlobal, CComObjectRootEx, IClassFactory


CComClassFactorySingleton Methods

IClassFactory Methods |
CreateInstance | Queries m_Obj for an interface pointer.

See Also

CComClassFactorySingleton Overview, CComClassFactorySingleton Data Members


CComClassFactorySingleton::CreateInstance

This method calls QueryInterface through m_Obj to retrieve an interface pointer.

Syntax

HRESULT CreateInstance( LPUNKNOWN pUnkOuter, REFIID riid, void** ppvObj );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactorySingleton Overview, CComClassFactorySingleton Methods, CoCreateInstance, CoGetClassObject


CComClassFactorySingleton Data Members

Data Members |
m_Obj | The CComObjectGlobal object constructed by CComClassFactorySingleton.

See Also

CComClassFactorySingleton Overview, CComClassFactorySingleton Methods


CComClassFactorySingleton::m_Obj

This data member is the CComObjectGlobal object constructed by CComClassFactorySingleton, where T is the class template parameter. Each call to the CreateInstance method simply queries this object for an interface pointer.

Syntax

CComObjectGlobal< T > m_Obj;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComClassFactorySingleton Overview, CComClassFactorySingleton Data Members


CComCoClass

The CComCoClass class provides methods for retrieving an object's CLSID and setting error information. Any class object that can be created externally should be derived from CComCoClass, which also defines the default class factory and aggregation model for your object.

Syntax

template< class T, const CLSID* pclsid >

class CComCoClass

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCoClass Methods


CComCoClass Methods

Methods |
Error | Returns rich error information to the client.
GetObjectCLSID | Returns the object's class identifier.
GetObjectDescription | Override to return the object's description.

See Also

CComCoClass Overview


CComCoClass::Error

The CComCoClass::Error method sets up the IErrorInfo interface to provide error information to the client. In order to call Error, your object must implement the ISupportErrorInfo interface.

Syntax

static HRESULT Error( LPCOLESTR lpszDesc, const IID& iid = GUID_NULL, HRESULT hRes = 0 );
static HRESULT Error( LPCOLESTR lpszDesc, DWORD dwHelpID, LPCOLESTR lpszHelpFile, const IID& iid = GUID_NULL, HRESULT hRes = 0 );
static HRESULT Error( LPCSTR lpszDesc, const IID& iid = GUID_NULL, HRESULT hRes = 0 );
static HRESULT Error( LPCSTR lpszDesc, DWORD dwHelpID, LPCSTR lpszHelpFile, const IID& iid = GUID_NULL, HRESULT hRes = 0 );
static HRESULT Error( UINT nID, const IID& iid = GUID_NULL, HRESULT hRes = 0, HINSTANCE hInst = _Module.GetResourceInstance( ) );
static HRESULT Error( UINT nID, DWORD dwHelpID, LPCOLESTR lpszHelpFile, const IID& iid = GUID_NULL, HRESULT hRes = 0, HINSTANCE hInst = _Module.GetResourceInstance( ) );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCoClass Overview, CComCoClass Methods, IErrorInfo , ISupportErrorInfo , ISupportErrorInfoImpl


CComCoClass::GetObjectCLSID

The CComCoClass::GetObjectCLSID method provides a consistent way of retrieving the object's CLSID.

Syntax

static const CLSID& GetObjectCLSID( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCoClass Overview, CComCoClass Methods


CComCoClass::GetObjectDescription

The CComCoClass::GetObjectDescription method retrieves the text description for your class object.

Syntax

static LPCTSTR WINAPI GetObjectDescription( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCoClass Overview, CComCoClass Methods


CComContainedObject

The CComContainedObject class is used in classes CComAggObject, CComPolyObject, and CComCachedTearOffObject. This class implements IUnknown by delegating to the owner object's IUnknown.

Syntax

template< class Base >

class CComContainedObject : public Base

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComContainedObject Methods, CComAggObject, CComCachedTearOffObject, CComPolyObject


CComContainedObject Methods

Class Methods |
CComContainedObject | Constructor. Initializes the member pointer to the owner object's IUnknown.
GetControllingUnknown | Retrieves the owner object's IUnknown.
IUnknown Methods |
AddRef | Increments the reference count on the owner object.
QueryInterface | Retrieves a pointer to the interface requested on the owner object.
Release | Decrements the reference count on the owner object.

See Also

CComContainedObject Overview


CComContainedObject::AddRef

This method increments the reference count on the owner object.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComContainedObject Overview, CComContainedObject Methods, CComContainedObject::Release


CComContainedObject::CComContainedObject

This method is the constructor, and sets the m_pOuterUnknown member pointer (inherited through the Base class) to pv.

Syntax

CComContainedObject( void* pv );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComContainedObject Overview, CComContainedObject Methods, CComObjectRootEx::m_pOuterUnknown


CComContainedObject::GetControllingUnknown

This method returns the m_pOuterUnknown member pointer (inherited through the Base class) which holds the owner object's IUnknown.

Syntax

IUnknown* GetControllingUnknown( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComContainedObject Overview, CComContainedObject Methods, CComObjectRootEx::m_pOuterUnknown


CComContainedObject::QueryInterface

This method retrieves a pointer to the interface requested on the owner object.

Syntax

HRESULT QueryInterface( REFIID iid, void** ppvObject );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComContainedObject Overview, CComContainedObject Methods


CComContainedObject::Release

This method decrements the reference count on the owner object.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComContainedObject Overview, CComContainedObject Methods, CComContainedObject::AddRef


CComControl

The CComControl class is a set of useful control helper functions and essential data members for ATL controls. When you create a full control or an Internet Explorer control using the ATL Object Wizard, the wizard will automatically derive your class from CComControl.

Syntax

template < class T >

class CComControl : public CComControlBase, public CWindowImpl< T >

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE 2.0 doesn't support metafiles, so the current version of ATL for Windows CE doesn't support the CComControlBase::IDataObject_GetData method or the CComControlBase::m_bDrawGetDataInHimetric data member.

In Windows CE, you cannot use the CComControlBase::IOleInPlaceObject_SetObjectRects method for clipping. Set the prcClip parameter to the same LPCRECT you pass in the prcPos parameter.

The CComControlBase class also doesn't support the DoVerbProperties method.

See Also

CComControl Methods, CComControl Data Members, CWindowImpl


CComControl Methods

CComControl Methods |
CComControl | Constructor
ControlQueryInterface | Retrieves a pointer to the requested interface.
CreateControlWindow | Creates a window for the control.
FireOnChanged | Notifies the container's sink that a control property has changed.
FireOnRequestEdit | Notifies the container's sink that a control property is about to change.
CComControlBase Methods |
CComControlBase | Constructor. Stores the window handle. Initializes the control data and sets a default control size.
DoesVerbActivate | Checks that the iVerb parameter used by IOleObjectImpl::DoVerb activates the control.
DoesVerbUIActivate | Checks that the iVerb parameter used by IOleObjectImpl::DoVerb causes the control's user interface to activate.
FireViewChange | Tells the control to discard any undo state it is maintaining.
GetDirty | Retrieves the value of the flag indicating whether the control's properties have changed since it was last saved.
GetZoomInfo | Retrieves the zoom factor and stores it in the ATL_DRAWINFO structure.
InPlaceActivate | Determines that the control can be in-place activated, informs the container the control is going in-place active, and activates the control.
OnDraw | Draws your control.
OnDrawAdvanced | Normalizes the device context, then calls your control class's OnDraw method.
OnGetDlgCode | Called in response to a WM_GETDLGCODE message. Override to have the control process TAB keys and arrow keys.
OnKillFocus | Informs the container the control has lost focus.
OnPaint | Prepares the container for painting, gets information about the control size, and calls your control class's OnDraw method.
OnSetFocus | Informs the container the control has gained focus.
SendOnClose | Called by the server to notify the control's advise sinks the control has changed from the running to the loaded state.
SendOnDataChange | Called by the server to notify the control's advise sinks that data in the control has changed.
SendOnRename | Called by the server to notify the control's advise sinks the control has been renamed.
SendOnSave | Called by the server to notify the control's advise sinks the control has been saved.
SendOnViewChange | Notifies the control's advise sinks its view has changed.
SetControlFocus | Sets or removes keyboard focus to or from the control.
SetDirty | Sets the value of the flag indicating that the control's properties have changed since it was last saved.
GetAmbient Property Methods |
GetAmbientAppearance | Gets the container's APPEARANCE property
GetAmbientAutoClip | Gets the container's AUTOCLIP property.
GetAmbientBackColor | Gets the container's BACKCOLOR property.
GetAmbientDisplayAsDefault | Gets the container's DISPLAYASDEFAULT property.
GetAmbientDisplayName | Gets the container's DISPLAYNAME property.
GetAmbientFont | Gets the container's FONT properties.
GetAmbientForeColor | Gets the container's FORECOLOR property.
GetAmbientLocaleID | Gets the container's LOCALEID property.
GetAmbientMessageReflect | Gets the container's MESSAGEREFLECT property.
GetAmbientPalette | Gets the container's PALETTE property.
GetAmbientProperty | Retrieves the specified container property.
GetAmbientScaleUnits | Gets the container's SCALEUNITS property.
GetAmbientShowGrabHandles | Gets the container's SHOWGRABHANDLES property.
GetAmbientShowHatching | Gets the container's SHOWHATCHING property.
GetAmbientSupportsMnemonics | Gets the container's SUPPORTSMNEMONICS property.
GetAmbientTextAlign | Gets the container's TEXTALIGN property.
GetAmbientUIDead | Gets the container's UIDEAD property.
GetAmbientUserMode | Gets the container's USERMODE property.

See Also

CComControl Overview, CComControl Data Members


CComControl::CComControl

The constructor calls the CComControlBase constructor, passing the m_hWnd data member inherited through CWindowImpl.

Syntax

CComControl( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::CComControlBase, CWindow::m_hWnd, CWindowImpl


CComControl::CComControlBase

This constructor stores a pointer to the window handle in the data member m_phWndCD.

Syntax

CComControlBase( HWND h );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_sizeExtent, CComControl::m_phWndCD


CComControl::ControlQueryInterface

This method retrieves a pointer to the requested interface, and only handles interfaces in the COM map table.

Syntax

virtual HRESULT ControlQueryInterface( const IID& iid, void** ppv );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComObjectRootEx::InternalQueryInterface


CComControl::CreateControlWindow

This method, by default, creates a window for the control by calling CWindowImpl::Create.

Syntax

virtual HWND CreateControlWindow( HWND hWndParent, RECT& rcPos );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CWindowImpl::Create


CComControl::DoesVerbActivate

This method checks that the iVerb parameter used by IOleObjectImpl::DoVerb either activates the control's user interface (iVerb equals OLEIVERB_UIACTIVATE), defines the action taken when the user double-clicks the control (iVerb equals OLEIVERB_PRIMARY), displays the control (iVerb equals OLEIVERB_SHOW), or activates the control (iVerb equals OLEIVERB_INPLACEACTIVATE).

Syntax

BOOL DoesVerbActivate( LONG iVerb );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview , CComControl Methods, IOleObjectImpl::DoVerb, CComControl::DoesVerbUIActivate


CComControl::DoesVerbUIActivate

This method checks that the iVerb parameter used by IOleObjectImpl::DoVerb causes the control's user interface to activate and returns TRUE. It also checks whether the control is in-place active.

Syntax

BOOL DoesVerbUIActivate( LONG iVerb );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, IOleObjectImpl::DoVerb, CComControl::DoesVerbActivate


CComControl::DoVerbProperties

This method displays the control's property pages.

Syntax

HRESULT DoVerbProperties( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, IOleObjectImpl::DoVerbPrimary


CComControl::FireOnChanged

This method calls CFirePropNotifyEvent::FireOnChanged to notify all connected IPropertyNotifySink interfaces that the specified control property has changed if your control class derives from IPropertyNotifySink. If your control class does not derive from IPropertyNotifySink, this method returns S_OK.

Syntax

HRESULT FireOnChanged( DISPID dispID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::FireOnRequestEdit


CComControl::FireOnRequestEdit

This method calls CFirePropNotifyEvent::FireOnRequestEdit to notify all connected IPropertyNotifySink interfaces that the specified control property is about to change, if your control class derives from IPropertyNotifySink. If your control class does not derive from IPropertyNotifySink, this method returns S_OK.

Syntax

HRESULT FireOnRequestEdit( DISPID dispID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::FireOnChanged


CComControl::FireViewChange

This method notifies the container that you want to redraw the entire control if the control is active (the control class data member m_bInPlaceActive is TRUE). If the control is inactive, this method notifies the control's registered advise sinks (through the control class data member m_spAdviseSink) that the control's view has changed.

Syntax

HRESULT FireViewChange( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientAppearance

This method retrieves DISPID_AMBIENT_APPEARANCE, the current appearance setting for the control: 0 for flat and 1 for 3D.

Syntax

HRESULT GetAmbientAppearance( short& nAppearance);

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientAutoClip

This method retrieves DISPID_AMBIENT_AUTOCLIP, a flag indicating whether the container supports automatic clipping of the control display area.

Syntax

HRESULT GetAmbientAutoClip( BOOL& bAutoClip );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientBackColor

This method retrieves DISPID_AMBIENT_BACKCOLOR, the ambient background color for all controls, defined by the container.

Syntax

HRESULT GetAmbientBackColor( OLE_COLOR& BackColor );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientDisplayAsDefault

This method retrieves DISPID_AMBIENT_DISPLAYASDEFAULT, a flag that is TRUE if the container has marked the control in this site to be a default button, and therefore a button control should draw itself with a thicker frame.

Syntax

HRESULT GetAmbientDisplayAsDefault( BOOL& bDisplayAsDefault );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientDisplayName

This method retrieves DISPID_AMBIENT_DISPLAYNAME, the name the container has supplied to the control.

Syntax

HRESULT GetAmbientDisplayName( BSTR& bstrDisplayName );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientFont

This method retrieves DISPID_AMBIENT_FONT, a pointer to the container's ambient IFont dispatch interface.

Syntax

HRESULT GetAmbientFont( IFont** ppFont );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientForeColor

This method retrieves DISPID_AMBIENT_FORECOLOR, the ambient foreground color for all controls, defined by the container.

Syntax

HRESULT GetAmbientForeColor( OLE_COLOR& ForeColor );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, GetAmbientLocaleId


CComControl::GetAmbientLocaleID

This method retrieves DISPID_AMBIENT_LOCALEID, the identifier of the language used by the container.

Syntax

HRESULT GetAmbientLocaleID( LCID& lcid );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientMessageReflect

This method retrieves DISPID_AMBIENT_MESSAGEREFLECT, a flag indicating whether the container wants to receive window messages (such as WM_DRAWITEM) as events.

Syntax

HRESULT GetAmbientMessageReflect( BOOL& bMessageReflect );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientPalette

This method retrieves DISPID_AMBIENT_PALETTE, used to access the container's HPALETTE.

Syntax

HRESULT GetAmbientPalette( HPALETTE& hPalette );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientProperty

This method retrieves the container property specified by id.

Syntax

HRESULT GetAmbientProperty( DISPID dispid, VARIANT& var );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_spClientSite


CComControl::GetAmbientScaleUnits

This method retrieves DISPID_AMBIENT_SCALEUNITS, the container's ambient units (such as inches or centimeters) for labeling displays.

Syntax

HRESULT GetAmbientScaleUnits( BSTR& bstrScaleUnits );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientShowGrabHandles

This method retrieves DISPID_AMBIENT_SHOWGRABHANDLES, a flag indicating whether the container allows the control to display grab handles for itself when active.

Syntax

HRESULT GetAmbientShowGrabHandles( BOOL& bShowGrabHandles );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientShowHatching

This method retrieves DISPID_AMBIENT_SHOWHATCHING, a flag indicating whether the container allows the control to display itself with a hatched pattern when UI active.

Syntax

HRESULT GetAmbientShowHatching( BOOL& bShowHatching );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientSupportsMnemonics

This method retrieves DISPID_AMBIENT_SUPPORTSMNEMONICS, a flag indicating whether the container supports keyboard mnemonics.

Syntax

HRESULT GetAmbientSupportsMnemonics( BOOL& bSupportsMnemonics );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientTextAlign

This method retrieves DISPID_AMBIENT_TEXTALIGN, the text alignment preferred by the container.

Syntax

HRESULT GetAmbientTextAlign( short& nTextAlign );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientUIDead

This method retrieves DISPID_AMBIENT_UIDEAD, a flag indicating whether the container wants the control to respond to user-interface actions.

Syntax

HRESULT GetAmbientUIDead( BOOL& bUIDead );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetAmbientUserMode

This method retrieves DISPID_AMBIENT_USERMODE, a flag indicating whether the container is in run-mode (TRUE) or design-mode (FALSE).

Syntax

HRESULT GetAmbientUserMode( BOOL& bUserMode );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::GetDirty

This method returns the value of data member m_bRequiresSave.

Syntax

BOOL GetDirty( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::SetDirty


CComControl::GetZoomInfo

This method retrieves the x and y values of the numerator and denominator of the zoom factor for a control activated for in-place editing.

Syntax

void GetZoomInfo( ATL_DRAWINFO& di );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_sizeNatural, CComControl::m_sizeExtent


CComControl::InPlaceActivate

This method causes the control to transition from the inactive state to whatever state the verb in iVerb indicates. This method also retrieves an IOleInPlaceSite, IOleInPlaceSiteEx, or IOleInPlaceSiteWindowless interface pointer for the control and stores it in the control class's data member m_spInPlaceSite.

Syntax

HRESULT InPlaceActivate( LONG iVerb, const RECT* prcPosRect = NULL );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, IOleInPlaceObjectWindowlessImpl::InPlaceDeactivate


CComControl::OnDraw

This method deletes or restores the device context or does nothing, depending on flags set in OnDrawAdvanced.

Syntax

virtual HRESULT OnDraw( ATL_DRAWINFO& di );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::OnDrawAdvanced, IViewObjectExImpl::Draw


CComControl::OnDrawAdvanced

This method prepares a normalized device context for drawing, then calls your control class's OnDraw method.

Syntax

virtual HRESULT OnDrawAdvanced( ATL_DRAWINFO& di );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::OnDraw, IViewObjectExImpl::Draw


CComControl::OnGetDlgCode

This method is called in response to a WM_GETDLGCODE window message.

Syntax

LRESULT OnGetDlgCode( UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::OnKillFocus

This method checks that the control is in-place active and has a valid control site, then informs the container the control has lost focus.

Syntax

LRESULT OnKillFocus( UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_bInPlaceActive, CComControl::m_spClientSite


CComControl::OnPaint

This method prepares the container for painting, gets the control's client area, then calls the control class's OnDraw method.

Syntax

LRESULT OnPaint( UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& lResult );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods , IViewObjectExImpl::Draw


CComControl::OnSetFocus

This method checks that the control is in-place active and has a valid control site, then informs the container the control has gained focus.

Syntax

LRESULT OnSetFocus( UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_bInPlaceActive , CComControl::m_spClientSite


CComControl::SendOnClose

This method notifies all advisory sinks registered with the advise holder that the control has been closed.

Syntax

HRESULT SendOnClose( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_spOleAdviseHolder


CComControl::SendOnDataChange

This method notifies all advisory sinks registered with the advise holder that the control data has changed.

Syntax

HRESULT SendOnDataChange( DWORD advf = 0);

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_spDataAdviseHolder


CComControl::SendOnRename

This method notifies all advisory sinks registered with the advise holder that the control has a new moniker.

Syntax

HRESULT SendOnRename( IMoniker* pmk );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_spOleAdviseHolder


CComControl::SendOnSave

This method notifies all advisory sinks registered with the advise holder that the control has been saved.

Syntax

HRESULT SendOnSave( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_spOleAdviseHolder


CComControl::SendOnViewChange

This method notifies all registered advisory sinks that the control's view has changed.

Syntax

HRESULT SendOnViewChange( DWORD dwAspect, LONG lindex = -1 );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods, CComControl::m_spAdviseSink


CComControl::SetControlFocus

This method sets or removes the keyboard focus to or from the control. For a windowed control, the Windows API function SetFocus is called. For a windowless control, IOleInPlaceSiteWindowless::SetFocus is called. Through this call, a windowless control obtains the keyboard focus and can respond to window messages.

Syntax

BOOL SetControlFocus( BOOL bGrab );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl::SetDirty

This method sets the data member m_bRequiresSave to the value in bDirty.

Syntax

void SetDirty( BOOL bDirty );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Methods


CComControl Data Members

Data Members |
m_bAutoSize | Flag indicating the control cannot be any other size, and SetExtent should fail.
m_bDrawFromNatural | Flag indicating that GetZoomInfo should use the control's actual size and not its current extent for the denominator when calculating the zoom factor.
m_bDrawGetDataInHimetric | Flag indicating that GetData should use HIMETRIC units and not pixels when drawing.
m_bEnabled | Flag indicating the control is enabled.
m_bInPlaceActive | Flag indicating the control is in-place active.
m_bInPlaceSiteEx | Flag indicating the container supports OCX96 control features, such as windowless and flicker-free controls.
m_bNegotiatedWnd | Flag indicating whether or not the control has negotiated with the container about being windowless or windowed.
m_bRecomposeOnResize | Flag indicating the control wants to recompose its presentation when the container changes the control's display size.
m_bRequiresSave | Flag indicating the control has changed since it was last saved.
m_bResizeNatural | Flag indicating the control wants to resize its natural extent (its unscaled physical size) when the container changes the control's display size.
m_bUIActive | Flag indicating the control's user interface is active.
m_bUsingWindowRgn | Flag indicating the control is using the container-supplied window region.
m_bWasOnceWindowless | Flag indicating the control has been windowless, but may or may not be windowless now.
m_bWindowOnly | Flag indicating the control should be windowed even if the container supports windowless controls.
m_bWndless | Flag indicating the control is windowless.
m_hWndCD | A reference to the window handle associated with the control.
m_nFreezeEvents | A count of the number of times the container has refused to accept events (a freeze of events) without an intervening acceptance of events (a thaw of events).
m_phWndCD | A pointer to the window handle associated with the control.
m_rcPos | The RECT position of the control.
m_sizeExtent | The SIZE of the control on a particular display in HIMETRIC units (each logical unit is 0.01 millimeter). This size is scaled by the display.
m_sizeNatural | The fixed physical SIZE of the control in HIMETRIC units (each logical unit is 0.01 millimeter). This size is not scaled by the display.
m_spAdviseSink | A COM interface pointer of type IAdviseSink.
m_spAmbientDispatch | A CComDispatchDriver object used to set and get properties through IDispatch.
m_spClientSite | A COM interface pointer of type IOleClientSite.
m_spDataAdviseHolder | A COM interface pointer of type IDataAdviseHolder.
m_spInPlaceSite | A pointer to the container's IOleInPlaceSite, IOleInPlaceSiteEx, or IOleInPlaceSiteWindowless COM interface.
m_spOleAdviseHolder | A COM interface pointer of type IOleAdviseHolder.
Stock Property Data Members |
m_bAutoSize | Stores the AUTOSIZE stock property.
m_bBorderVisible | Stores the BORDERVISIBLE stock property.
m_bEnabled | Stores the ENABLED stock property.
m_bstrCaption | Stores the CAPTION stock property.
m_bstrText | Stores the TEXT stock property.
m_bTabStop | Stores the TABSTOP stock property.
m_bValid | Stores the VALID stock property.
m_clrBackColor | Stores the BACKCOLOR stock property.
m_clrBorderColor | Stores the BORDERCOLOR stock property.
m_clrFillColor | Stores the FILLCOLOR stock property.
m_clrForeColor | Stores the FORECOLOR stock property.
m_nAppearance | Stores the APPEARANCE stock property.
m_nBackStyle | Stores the BACKSTYLE stock property.
m_nBorderStyle | Stores the BORDERSTYLE stock property.
m_nBorderWidth | Stores the BORDERWIDTH stock property.
m_nDrawMode | Stores the DRAWMODE stock property.
m_nDrawStyle | Stores the DRAWSTYLE stock property.
m_nDrawWidth | Stores the DRAWWIDTH stock property.
m_nFillStyle | Stores the FILLSTYLE stock property.
m_nMousePointer | Stores the MOUSEPOINTER stock property.
m_nReadyState | Stores the READYSTATE stock property.
m_pFont | Stores the FONT stock property.
m_pMouseIcon | Stores the MOUSEICON stock property.
m_pPicture | Stores the PICTURE stock property.

See Also

CComControl Overview, CComControl Methods


CComControl::m_bAutoSize

This data member is a flag that indicates the control cannot be any other size.

Syntax

unsigned m_bAutoSize:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, IOleObjectImpl::SetExtent


CComControl::m_bBorderVisible

This data member in your control class that flags whether the control's border should be visible or not.

Syntax

BOOL m_bBorderVisible;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_nBorderStyle, CComControl::m_clrBorderColor, CComControl::m_nBorderWidth


CComControl::m_bDrawFromNatural

This data member is a flag indicating that IDataObjectImpl::GetData should set the control size from m_sizeNatural rather than from m_sizeExtent.

Syntax

unsigned m_bDrawFromNatural:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, IDataObjectImpl::GetData, CComControl::m_sizeNatural, CComControl::m_sizeExtent


CComControl::m_bDrawGetDataInHimetric

This data member is a flag that indicates that IDataObjectImpl::GetData should use HIMETRIC units and not pixels when drawing.

Syntax

unsigned m_bDrawGetDataInHimetric:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, IDataObjectImpl::GetData


CComControl::m_bEnabled

This data member is a flag that indicates the control is enabled.

Syntax

unsigned m_bEnabled:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bInPlaceActive, CComControl::m_bUIActive


CComControl::m_bInPlaceActive

This data member is a flag that indicates the control is in-place active.

Syntax

unsigned m_bInPlaceActive:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bEnabled, CComControl::m_bUIActive


CComControl::m_bInPlaceSiteEx

This data member is a flag that indicates the container supports the IOleInPlaceSiteEx interface and OCX96 control features, such as windowless and flicker-free controls.

Syntax

unsigned m_bInPlaceSiteEx:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bWndless, CComControl::m_bNegotiatedWnd, CComControl::m_spInPlaceSite


CComControl::m_bNegotiatedWnd

This data member is a flag that indicates whether or not the control has negotiated with the container about support for OCX96 control features (such as flicker-free and windowless controls), and whether the control is windowed or windowless.

Syntax

unsigned m_bNegotiatedWnd:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bWndless, CComControl::m_spInPlaceSite


CComControl::m_bRecomposeOnResize

This data member is a flag that indicates the control wants to recompose its presentation when the container changes the control's display size.

Syntax

unsigned m_bRecomposeOnResize:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, IOleObjectImpl::SetExtent


CComControl::m_bRequiresSave

This data member is a flag that indicates the control has changed since it was last saved.

Syntax

unsigned m_bRequiresSave:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::SetDirty, CComControl::GetDirty


CComControl::m_bResizeNatural

This data member is a flag that indicates the control wants to resize its natural extent (its unscaled physical size) when the container changes the control's display size.

Syntax

unsigned m_bResizeNatural:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, IOleObjectImpl::SetExtent, CComControl::m_sizeNatural, CComControl::m_sizeExtent


CComControl::m_bstrCaption

This data member in your control class is the one that holds text to be displayed with the control.

Syntax

BSTR m_bstrCaption;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bstrText


CComControl::m_bstrText

This data member in your control class is the one that holds text to be displayed with the control.

Syntax

BSTR m_bstrText;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bstrCaption


CComControl::m_bTabStop

This data member flags whether the control is a tab stop or not.

Syntax

BOOL m_bTabStop;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members


CComControl::m_bUIActive

This data member is a flag that indicates that the control's user interface, such as menus and toolbars, is active.

Syntax

unsigned m_bUIActive:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bEnabled, CComControl::m_bInPlaceActive


CComControl::m_bUsingWindowRgn

This data member is a flag that indicates that the control is using the container-supplied window region.

Syntax

unsigned m_bUsingWindowRgn:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members


CComControl::m_bValid

This data member flags whether the control is valid or not.

Syntax

BOOL m_bValid;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members


CComControl::m_bWasOnceWindowless

This data member is a flag that indicates that the control has been windowless, but may or may not be windowless now.

Syntax

unsigned m_bWasOnceWindowless:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bWndless


CComControl::m_bWindowOnly

This data member is a flag that indicates that the control should be windowed, even if the container supports windowless controls.

Syntax

unsigned m_bWindowOnly:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bWndless


CComControl::m_bWndless

This data member is a flag that indicates that the control is windowless.

Syntax

unsigned m_bWndless:1;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_spInPlaceSite , CComControl::m_bInPlaceSiteEx, CComControl::m_bNegotiatedWnd, CComControl::m_bWindowOnly, CComControl::m_bWasOnceWindowless


CComControl::m_clrBackColor

This data member holds the control's background color.

Syntax

OLE_COLOR m_clrBackColor;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_clrBorderColor , CComControl::m_clrFillColor, CComControl::m_clrForeColor


CComControl::m_clrBorderColor

This data member holds the control's border color.

Syntax

OLE_COLOR m_clrBorderColor;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_clrBackColor , CComControl::m_clrFillColor, CComControl::m_clrForeColor


CComControl::m_clrFillColor

This data member holds the control's fill color.

Syntax

OLE_COLOR m_clrFillColor;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_clrBackColor , CComControl::m_clrBorderColor, CComControl::m_clrForeColor


CComControl::m_clrForeColor

This data member holds the control's foreground color.

Syntax

OLE_COLOR m_clrForeColor;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_clrBackColor , CComControl::m_clrBorderColor, CComControl::m_clrFillColor


CComControl::m_hWndCD

This data member contains a reference to the window handle associated with the control.

Syntax

HWND& m_hWndCD;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::CComControl , CComControl::m_phWndCD


CComControl::m_nAppearance

This data member stores the paint style used by the control, for example, flat or 3D.

Syntax

long m_nAppearance;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_nDrawMode


CComControl::m_nBackStyle

This data member stores the control's background style, either transparent or opaque.

Syntax

long m_nBackStyle;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_nFillStyle


CComControl::m_nBorderStyle

This data member stores the control's border style.

Syntax

long m_nBorderStyle;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bBorderVisible , CComControl::m_clrBorderColor, CComControl::m_nBorderWidth


CComControl::m_nBorderWidth

This data member stores the control's border width.

Syntax

long m_nBorderWidth;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_bBorderVisible , CComControl::m_clrBorderColor, CComControl::m_nBorderStyle


CComControl::m_nDrawMode

This data member stores the appearance of output from the control's graphics methods, for example, XOR Pen or Invert Colors

Syntax

long m_nDrawMode;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_nDrawWidth , CComControl::m_nDrawStyle


CComControl::m_nDrawStyle

This data member stores the line style used by the control's drawing methods, for example, solid, dashed, or dotted.

Syntax

long m_nDrawStyle;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members , CComControl::m_nDrawWidth, CComControl::m_nDrawMode


CComControl::m_nDrawWidth

This data member stores the line width (in pixels) used by the control's drawing methods.

Syntax

long m_nDrawWidth;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members , CComControl::m_nDrawStyle, CComControl::m_nDrawMode


CComControl::m_nFillStyle

This data member stores the control's fill style, for example, solid, transparent, or cross-hatched..

Syntax

long m_nFillStyle;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_nBackStyle


CComControl::m_nFreezeEvents

This data member is a count of the number of times the container has frozen events (refused to accept events) without an intervening thaw of events (acceptance of events).

Syntax

short m_nFreezeEvents;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, IOleControlImpl::FreezeEvents


CComControl::m_nMousePointer

This data member stores the type of mouse pointer displayed when the mouse is over the control, for example, arrow, cross, or hourglass.

Syntax

long m_nMousePointer;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_pMouseIcon


CComControl::m_nReadyState

This data member stores the control's readiness state, for example, loading or loaded.

Syntax

long m_nReadyState;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members


CComControl::m_pFont

This data member stores a pointer to IFontDisp font properties.

Syntax

IFontDisp* m_pFont;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview , CComControl Data Members


CComControl::m_phWndCD

This data member contains a pointer to the window handle associated with the control.

Syntax

HWND* m_phWndCD;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::CComControl , CComControl::m_hWndCD


CComControl::m_pMouseIcon

This data member is The data member that stores a pointer to IPictureDisp picture properties of the graphic (icon, bitmap, or metafile) to be displayed when the mouse is over the control.

Syntax

IPictureDisp* m_pMouseIcon;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_nMousePointer


CComControl::m_pPicture

This data member is the one that stores a pointer to IPictureDisp picture properties of a graphic (icon, bitmap, or metafile) to be displayed.

Syntax

IPictureDisp* m_pPicture;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_pMouseIcon


CComControl::m_rcPos

This data member is the position in pixels of the control, expressed in the coordinates of the container.

Syntax

RECT m_rcPos;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members , CComControl::m_sizeExtent,, CComControl::m_sizeNatural


CComControl::m_sizeExtent

This data member stores the extent of the control in HIMETRIC units (each unit is 0.01 millimeters) for a particular display.

Syntax

SIZE m_sizeExtent;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComControl::m_sizeNatural , CComControl::m_rcPos


CComControl::m_sizeNatural

This data member stores the physical size of the control in HIMETRIC units (each unit is 0.01 millimeters).

Syntax

SIZE m_sizeNatural;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members , CComControl::m_sizeExtent, CComControl::m_rcPos


CComControl::m_spAdviseSink

This data member is a direct pointer to the advisory connection on the container (the container's IAdviseSink).

Syntax

CComPtr<IAdviseSink> m_spAdviseSink;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComPtr


CComControl::m_spAmbientDispatch

This data member is a CComDispatchDriver object that lets you retrieve and set an object's properties through an IDispatch pointer.

Syntax

CComDispatchDriver m_spAmbientDispatch;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComDispatchDriver


CComControl::m_spClientSite

This data member is a pointer to the control's client site within the container.

Syntax

CComPtr<IOleClientSite> m_spClientSite;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComPtr


CComControl::m_spDataAdviseHolder

This data member provides a standard means to hold advisory connections between data objects and advise sinks.

Syntax

CComPtr<IDataAdviseHolder> m_spDataAdviseHolder;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComPtr


CComControl::m_spInPlaceSite

This data member is a pointer to the container's IOleInPlaceSite, IOleInPlaceSiteEx, or IOleInPlaceSiteWindowless interface pointer.

Syntax

CComPtr<IOleInPlaceSiteWindowless> m_spInPlaceSite;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComPtr


CComControl::m_spOleAdviseHolder

This data member provides a standard implementation of a way to hold advisory connections.

Syntax

CComPtr<IOleAdviseHolder> m_spOleAdviseHolder;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComControl Overview, CComControl Data Members, CComPtr


CComCriticalSection

CComCriticalSection provides methods for obtaining and releasing ownership of a critical section object. CComCriticalSection is similar to class CComAutoCriticalSection, except that you must explicitly initialize and release the critical section.

class CComCriticalSection

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCriticalSection Methods, CComCriticalSection Data Members, CComAutoCriticalSection


CComCriticalSection Methods

Methods
Init | Creates and initializes a critical section object.
Lock | Obtains ownership of the critical section object.
Term | Releases system resources used by the critical section object..
Unlock | Releases ownership of the critical section object.

See Also

CComCriticalSection Overveiw, CComCriticalSection Data Members


CComCriticalSection::Init

This method calls the Win32 function InitializeCriticalSection, which initializes the critical section object contained in the m_sec data member.

Syntax

void Init( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCriticalSection Overveiw, CComCriticalSection Methods, CComCriticalSection::m_sec


CComCriticalSection::Lock

This method calls the Win32 function EnterCriticalSection, which waits until the thread can take ownership of the critical section object contained in the m_sec data member. The critical section object must first be initialized with a call to the Init method. When the protected code has finished executing, the thread must call Unlock to release ownership of the critical section.

Syntax

void Lock( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCriticalSection Overveiw, CComCriticalSection Methods, CComCriticalSection::Init , CComCriticalSection::Unlock, CComCriticalSection::m_sec, EnterCriticalSection


CComCriticalSection::Term

This method calls the Win32 function DeleteCriticalSection, which releases all resources used by the critical section object contained in the m_sec data member. Once Term has been called, the critical section can no longer be used for synchronization.

Syntax

void Term( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCriticalSection Overveiw, CComCriticalSection Methods, CComCriticalSection::m_sec, DeleteCriticalSection


CComCriticalSection::Unlock

This method calls the Win32 function LeaveCriticalSection, which releases ownership of the critical section object contained in the m_sec data member. To first obtain ownership, the thread must call the Lock method. Each call to Lock requires a corresponding call to Unlock to release ownership of the critical section.

Syntax

void Unlock( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCriticalSection Overveiw, CComCriticalSection Methods, CComCriticalSection::Lock , CComCriticalSection::Unlock, CComCriticalSection::m_sec, LeaveCriticalSection


CComCriticalSection Data Members

Data Members
m_sec Contains a critical section object that is used by all CComCriticalSection methods.

See Also

CComCriticalSection Overveiw, CComCriticalSection Methods


CComCriticalSection::m_sec

This data member contains a critical section object that is used by all CComCriticalSection methods.

CRITICAL_SECTION m_sec;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComCriticalSection Overveiw, CComCriticalSection Data Members, CComCriticalSection::Lock , CComCriticalSection::Unlock, CComCriticalSection::Init, CComCriticalSection::Term


CComDispatchDriver

CComDispatchDriver lets you retrieve or set an object's properties through an IDispatch pointer.

Syntax

class CComDispatchDriver

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Methods, CComDispatchDriver Operators, CComDispatchDriver Data Members


CComDispatchDriver Methods

CComDispatchDriver Methods |
CComDispatchDriver | Constructor. Initializes the data member p to NULL.
GetProperty | Gets the value of a property exposed by an object.
PutProperty | Sets the value of a property exposed by an object.
Release | Releases the IDispatch pointer and sets it to NULL.

See Also

CComDispatchDriver Overview, CComDispatchDriver Operators, CComDispatchDriver Data Members


CComDispatchDriver::CComDispatchDriver

This method is the constructor. If there is no lp parameter, the constructor initializes the data member p to NULL. If lp points to an IDispatch interface, the constructor sets p to that interface and calls AddRef. If lp points to an IUnknown interface, the constructor calls QueryInterface for the IDispatch interface and sets p to that interface.

Syntax

CComDispatchDriver( );

CComDispatchDriver( IDispatch* lp );

CComDispatchDriver( IUnknown* lp ));

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Methods


CComDispatchDriver::GetProperty

This method gets the value of the property identified by dwDispID. If you supply pDisp, that IDispatch pointer is used. If you do not, the IDispatch pointer contained in the data member p is used.

Syntax

HRESULT GetProperty( DISPID dwDispID, VARIANT* var );

static HRESULT GetProperty( IDispatch* pDisp, DISPID dwDispID, VARIANT* var );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Methods, CComDispatchDriver::PutProperty


CComDispatchDriver::PutProperty

This method sets the value of the property identified by dwDispID to the value in var. If you supply pDisp, that IDispatch pointer is used. If you do not, the IDispatch pointer contained in the data member p is used.

Syntax

HRESULT PutProperty( DISPID dwDispID, VARIANT* var );

static HRESULT PutProperty( IDispatch* pDisp, DISPID dwDispID, VARIANT* var );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Methods, CComDispatchDriver::GetProperty


CComDispatchDriver::Release

This method checks whether data member p points to an IDispatch interface and, if it does, releases the interface and sets p to NULL.

Syntax

void Release( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Methods


CComDispatchDriver Operators

CComDispatchDriver Operators |
operator Idispatch* | Converts a ComDispatchDriver object to an IDispatch pointer.
operator * | Returns the dereferenced value of the data member p.
operator & | Returns the address of data member p.
operator -> | Returns the data member p.
operator = | Sets the data member p to the specified IDispatch interface pointer.
operator ! | Checks whether the data member p is NULL or not.

See Also

CComDispatchDriver Overview, CComDispatchDriver Methods, CComDispatchDriver Data Members


CComDispatchDriver::operator IDispatch*

This operator converts a CComDispatchDriver object to an IDispatch pointer by returning the data member p.

Syntax

operator IDispatch*( ) ;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Operators


CComDispatchDriver::operator *

This operator returns the dereferenced value of the IDispatch interface pointer stored in the data member p.

Syntax

IDispatch& operator *( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Operators


CComDispatchDriver::operator &

This operator returns the address of the IDispatch interface pointer stored in the data member p. The operation will assert if p is non-NULL. This operator avoids memory leaks if you want to set p without releasing it first.

Syntax

IDispatch** operator &( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Operators


CComDispatchDriver::operator ->

This operator returns the IDispatch interface pointer stored in the data member p.

Syntax

IDispatch* operator ->( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Operators


CComDispatchDriver::operator =

This operator sets the data member p to an IDispatch interface pointer or to a pointer to an IDispatch interface obtained through an IUnknown pointer.

Syntax

IDispatch* operator =( IDispatch* lp ) ;

IDispatch* operator =( IUnknown* lp ) ;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Operators


CComDispatchDriver::operator !

This operator returns TRUE if the data member p is NULL; otherwise it returns FALSE.

Syntax

BOOL operator !( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Operators


CComDispatchDriver Data Members

CComDispatchDriver Data Members |
p | Pointer to the IDispatch interface.

See Also

CComDispatchDriver Overview, CComDispatchDriver Methods, CComDispatchDriver Operators


CComDispatchDriver::p

This data member the pointer to the IDispatch interface.

Syntax

IDispatch* p;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDispatchDriver Overview, CComDispatchDriver Data Members, CComDispatchDriver::operator =


CComDynamicUnkArray

CComDynamicUnkArray holds a dynamically allocated array of IUnknown pointers, each an interface on a connection point. CComDynamicUnkArray can be used as a parameter to the IConnectionPointImpl template class.

Syntax

class CComDynamicUnkArray

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDynamicUnkArray Methods, CComUnkArray , IConnectionPointImpl


CComDynamicUnkArray Methods

CComDynamicUnkArray Methods |
begin | Returns a pointer to the first IUnknown pointer in the collection.
CComDynamicUnkArray | Constructor. Initializes the collection values to NULL and the collection size to zero.
end | Returns a pointer to one past the last IUnknown pointer in the collection.

See Also

CComDynamicUnkArray Overview


CComDynamicUnkArray::begin

This method returns a pointer to one past the last IUnknown pointer in the collection

Syntax

IUnknown** begin( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDynamicUnkArray Overview, CComDynamicUnkArray Methods, CComDynamicUnkArray::end , CComUnkArray::begin


CComDynamicUnkArray::CComDynamicUnkArray

This method is the class constructor. It sets the collection size to zero and initializes the values to NULL.

Syntax

CComDynamicUnkArray( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDynamicUnkArray Overview, CComDynamicUnkArray Methods


CComDynamicUnkArray::end

This method returns a pointer to the beginning of the collection of IUnknown interface pointers.

Syntax

IUnknown** end( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComDynamicUnkArray Overview, CComDynamicUnkArray Methods, CComDynamicUnkArray::begin , CComUnkArray::end


CComFakeCriticalSection

CComFakeCriticalSection mirrors the methods found in CComCriticalSection and CComAutoCriticalSection. However, CComFakeCriticalSection does not provide a critical section; therefore, its methods do nothing.

When using the single threaded model (CComSingleThreadModel), or the multi-threaded model without critical sections (CComMultiThreadModelNoCS), CComCriticalSection and CComAutoCriticalSection are both typedef'd as CComFakeCriticalSection.

Syntax

class CComFakeCriticalSection

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComFakeCriticalSection Methods, CComCriticalSection , CComSingleThreadModel, CComMultiThreadModelNoCS


CComFakeCriticalSection Methods

CComFakeCriticalSection Methods |
Init | Does nothing.
Lock | Does nothing.
Term | Does nothing.
Unlock | Does nothing.

See Also

CComFakeCriticalSection Overview


CComFakeCriticalSection::Init

This method does nothing since there is no critical section.

Syntax

void Init( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComFakeCriticalSection Overview, CComFakeCriticalSection Methods, CComCriticalSection::Init


CComFakeCriticalSection::Lock

This method does nothing since there is no critical section.

Syntax

void Lock( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComFakeCriticalSection Overview, CComFakeCriticalSection Methods, CComCriticalSection::Lock


CComFakeCriticalSection::Term

This method does nothing since there is no critical section.

Syntax

void Term( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComFakeCriticalSection Overview, CComFakeCriticalSection Methods, CComCriticalSection::Term


CComFakeCriticalSection::Unlock

This method does nothing since there is no critical section.

Syntax

void Unlock( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComFakeCriticalSection Overview, CComFakeCriticalSection Methods, CComCriticalSection::Unlock


CComGlobalsThreadModel

#if defined( _ATL_SINGLE_THREADED )
typedef CComSingleThreadModel CComGlobalsThreadModel;
#elif defined (_ATL_APARTMENT_THREADED)
typedef CComSingleThreadModel CComGlobalsThreadModel
#else
typedef CComMultiThreadModel CComGlobalsThreadModel;
#endif

Depending on the threading model used by your application, the typedef name CComGlobalsThreadModel references either CCComSingleThreadModel or CCComMultThreadModel. These classes provide additional typedef names to reference a critical section class.

Using CComGlobalsThreadModel frees you from specifying a particular threading model class. Regardless of the threading model being used, the appropriate methods will be called.

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE only supports the single threading and free threading models. It doesn't support the apartment threading model.

See Also

CComObjectRootEx


CComModule

This class implements a COM server module, allowing a client to access the module's components.

Syntax

class CComModule : public _ATL_MODULE

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Methods, CComModule Data Members


CComModule Methods

CComModule Methods | Description
GetClassObject | Creates an object of a specified CLSID
GetLockCount | Returns the current lock count
GetModuleInstance | Returns m_hInst
GetResourceInstance | Returns m_hInstResource
GetTypeLibInstance | Returns m_hInstTypeLib
Init | Initializes data members
Lock | Increments the module lock count
RegisterClassHelper | Enters an object's standard class registration in the system registry
RegisterClassObjects | Registers the Class Factory in the Running Object Table
RegisterServer | Updates the system registry for each object in the object map
RegisterTypeLib | Registers a type library
RevokeClassObjects | Removes the class factory from the Running Object Table
Term | Releases data members
Unlock | Decrements the module lock count
UnregisterClassHelper | Removes an object's standard class registration from the system registry
UnregisterServer | Unregisters each object in the object map
UpdateRegistryClass | Registers or unregisters an object's standard class
UpdateRegistryFromResourceD | Runs the script contained in a specified resource to register or unregister an object
UpdateRegistryFromResourceS | Statically links to the ATL Registry Component.

See Also

CComModule Overview, CComModule Data Members


CComModule::GetClassObject

This method creates an object of a specified CLSID.

Syntax

HRESULT GetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ppv );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods


CComModule::GetLockCount

This method returns the current lock count.

Syntax

LONG GetLockCount( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::Lock , CComModule::Unlock, CComModule::m_nLockCnt


CComModule::GetModuleInstance

This method returns m_hInst.

Syntax

HINSTANCE GetModuleInstance( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::GetResourceInstance CComModule::GetTypeLibInstance


CComModule::GetResourceInstance

This method returns the value of m_hInstResource.

Syntax

HINSTANCE GetResourceInstance( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::GetModuleInstance , CComModule::GetTypeLibInstance


CComModule::GetTypeLibInstance

This method returns the value of m_hInstTypeLib.

Syntax

HINSTANCE GetTypeLibInstance( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::GetModuleInstance , CComModule::GetResourceInstance


CComModule::Init

This method initializes the data members.

Syntax

void Init( _ATL_OBJMAP_ENTRY* p, HINSTANCE h );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::Term


CComModule::Lock

This method increments the module lock count.

Syntax

LONG Lock( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::Unlock , CComModule::GetLockCount, CComModule::m_nLockCnt


CComModule::RegisterClassHelper

This method enters an object's standard class registration in the system registry.

Syntax

HRESULT RegisterClassHelper( const CLSID& clsid, LPCTSTR lpszProgID, LPCTSTR lpszVerIndProgID, UINT nDescID, DWORD dwFlags );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::UnregisterClassHelper


CComModule::RegisterClassObjects

This method registers the Class Factory in the Running Object Table.

Syntax

HRESULT RegisterClassObjects( DWORD dwClsContext, DWORD* dwFlags );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::RevokeClassObjects


CComModule::RegisterServer

This method updates the system registry for each object in the object map.

Syntax

HRESULT RegisterServer( BOOL bRegTypeLib = FALSE, const CLSID* pCLSID = NULL );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::UnregisterServer


CComModule::RegisterTypeLib

This method registers a type library.

Syntax

HRESULT RegisterTypeLib( );

HRESULT RegisterTypeLib( LPCTSTR lpszIndex );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods


CComModule::RevokeClassObjects

This method removes the Class Factory from the Running Object Table.

Syntax

HRESULT RevokeClassObjects( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::RegisterClassObjects


CComModule::Term

This method releases all data members.

Syntax

void Term( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::Init


CComModule::Unlock

This method decrements the module lock count.

Syntax

LONG Unlock( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::Lock , CComModule::GetLockCount, CComModule::m_nLockCnt


CComModule::UnregisterClassHelper

This method removes an object's standard class registration from the system registry.

Syntax

HRESULT UnregisterClassHelper( const CLSID& clsid, LPCTSTR lpszProgID, LPCTSTR lpszVerIndProgID );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::RegisterClassHelper


CComModule::UnregisterServer

This method unregisters each object in the object map.

Syntax

HRESULT UnregisterServer( const CLSID* pCLSID = NULL );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods, CComModule::RegisterServer


CComModule::UpdateRegistryClass

This method registers or unregisters an object's standard class.

Syntax

HRESULT UpdateRegistryClass( const CLSID& clsid, LPCTSTR lpszProgID, LPCTSTR lpszVerIndProgID, UINT nDescID, DWORD dwFlags, BOOL bRegister );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods


CComModule::UpdateRegistryFromResourceD

This method runs the script contained in a specified resource to register or unregister an object.

Syntax

HRESULT UpdateRegistryFromResourceD( LPCTSTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY* pMapEntries = NULL );

HRESULT UpdateRegistryFromResourceD( UINT nResID, BOOL bRegister, struct _ATL_REGMAP_ENTRY* pMapEntries = NULL );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods


CComModule::UpdateRegistryFromResourceS

This method statically links to the ATL Registry Component.

Syntax

HRESULT UpdateRegistryFromResourceS( LPCTSTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY* pMapEntries = NULL );

HRESULT UpdateRegistryFromResourceS( UINT nResID, BOOL bRegister, struct _ATL_REGMAP_ENTRY* pMapEntries = NULL );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Methods


CComModule Data Members

CComModule Data Members |
m_csObjMap | Ensures synchronized access to the object map information
m_csTypeInfoHolder | Ensures synchronized access to the type library information
m_csWindowCreate | Ensures synchronized access to window class information.
m_hHeap | Contains the handle to the heap managed by the module
m_hInst | Contains the handle to the module instance
m_hInstResource | By default, contains the handle to the module instance
m_hInstTypeLib | By default, contains the handle to the module instance
m_nLockCnt | Contains the current lock count on the module
m_pObjectMap | Points to the object map maintained by the module instance

See Also

CComModule Overview, CComModule Methods


CComModule::m_csObjMap

This data member ensures synchronized access to the object map information.

Syntax

CRITICAL_SECTION m_csObjMap;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComModule::m_csTypeInfoHolder

This data member ensures synchronized access to the object type library information.

Syntax

CRITICAL_SECTION m_csTypeInfoHolder;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComModule::m_csWindowCreate

This data member ensures synchronized access to window class information.

Syntax

CRITICAL_SECTION m_csWindowCreate;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComModule::m_hHeap

This data member contains the handle to the heap managed by the module.

Syntax

HANDLE m_hHeap;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComModule::m_hInst

This data member contains the handle to the module instance.

Syntax

HINSTANCE m_hInst;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComModule::m_hInstResource

By default, this data member contains the handle to the module instance.

Syntax

HINSTANCE m_hInstResource;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComModule::m_hInstTypeLib

By default, this data member contains the handle to the module instance.

Syntax

HINSTANCE m_hInstTypeLib;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComModule::m_nLockCnt

This data member contains the current lock count on the module.

Syntax

LONG m_nLockCnt;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members, CComModule::GetLockCount , CComModule::Lock, CComModule::Unlock


CComModule::m_pObjectMap

This data member points to the object map maintained by the module instance.

Syntax

_ATL_OBJMAP_ENTRY* m_pObjMap;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComModule Overview, CComModule Data Members


CComMultiThreadModel

The CComMultiThreadModel class provides thread-safe methods for incrementing and decrementing the value of a variable.

Syntax

class CComMultiThreadModel

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModel Methods, CComMultiThreadModel TypeDefs, CComSingleThreadModel , CComAutoCriticalSection


CComMultiThreadModel Methods

Class Methods |
Decrement | Decrements the value of the specified variable in a thread-safe manner
Increment | Increments the value of the specified variable in a thread-safe manner

See Also

CComMultiThreadModel Overview, CComMultiThreadModel TypeDefs


CComMultiThreadModel::Decrement

This method decrements the specified variable in a thread-safe way.

Syntax

static ULONG Decrement( LPLONG p);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModel Overview, CComMultiThreadModel Methods, CComMultiThreadModel::Increment


CComMultiThreadModel::Increment

This method increments the specified variable in a thread-safe way.

Syntax

static ULONG Increment( LPLONG p);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModel Overview, CComMultiThreadModel Methods, CComMultiThreadModel::Decrement


CComMultiThreadModel TypeDefs

Class Typedefs |
AutoCriticalSection | References the CComAutoCriticalSection class
CriticalSection | References the CComCriticalSection class
ThreadModelNoCS | References the CComMultiThreadModelNoCS class

See Also

CComMultiThreadModel Overview, CComMultiThreadModel Methods


CComMultiThreadModel::AutoCriticalSection

This typdef references the CComAutoCriticalSection class.

Syntax

typedef CComAutoCriticalSection AutoCriticalSection

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModel Overview, CComMultiThreadModel TypeDefs, CComObjectThreadModel , CComGlobalsThreadModel, CComMultiThreadModel::ThreadModelNoCS


CComMultiThreadModel::CriticalSection

This typdef references the CComCriticalSection class.

Syntax

typedef CComCriticalSection CriticalSection

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModel Overview, CComMultiThreadModel TypeDefs, CComObjectThreadModel , CComGlobalsThreadModel, CComMultiThreadModel::ThreadModelNoCS


CComMultiThreadModel::ThreadModelNoCS

This typdef references the CComMultiThreadModelNoCS class.

Syntax

typedef CComMultiThreadModelNoCS ThreadModelNoCS

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModel Overview, CComMultiThreadModel TypeDefs, CComObjectThreadModel , CComGlobalsThreadModel


CComMultiThreadModelNoCS

The CComMultiThreadModelNoCS class is similar to CComMultiThreadModel, in that it provides thread-safe methods for incrementing and decrementing variables. However, when referencing a critical section class through CComMultiThreadModelNoCS, method's such as Lock and Unlock will do nothing.

Syntax

class CComMultiThreadModelNoCS

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModelNoCS Methods, CComMultiThreadModelNoCS TypeDefs, CComSingleThreadModel , CComAutoCriticalSection, CComMultiThreadModel


CComMultiThreadModelNoCS Methods

CComMultiThreadModelNoCS::Decrement | Decrements the value of the specified variable in a thread-safe manner
CComMultiThreadModelNoCS::Increment | Increments the value of the specified variable in a thread-safe manner

See Also

CComMultiThreadModelNoCS Overview, CComMultiThreadModelNoCS TypeDefs


CComMultiThreadModelNoCS::Decrement

This method decrements the specified variable in a thread-safe way.

Syntax

static ULONG Decrement( LPLONG p);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModelNoCS Overview, CComMultiThreadModelNoCS Methods, CComMultiThreadModelNoCS::Increment


CComMultiThreadModelNoCS::Increment

This method increments the specified variable in a thread-safe way.

Syntax

static ULONG Increment( LPLONG p);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModelNoCS Overview, CComMultiThreadModelNoCS Methods, CComMultiThreadModelNoCS::Decrement


CComMultiThreadModelNoCS Typedefs

CComMultiThreadModelNoCS Typedefs |
AutoCriticalSection | References the CComFakeCriticalSection class
CriticalSection | References the CComFakeCriticalSection class
ThreadModelNoCS | References the CComMultiThreadModelNoCS class

See Also

CComMultiThreadModelNoCS Overview, CComMultiThreadModelNoCS Methods


CComMultiThreadModelNoCS::AutoCriticalSection

This typdef references the CComFakeCriticalSection class.

Syntax

typedef CComFakeCriticalSection AutoCriticalSection

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModelNoCS Overview, CComMultiThreadModelNoCS TypeDefs, CComObjectThreadModel , CComGlobalsThreadModel, CComMultiThreadModelNoCS::ThreadModelNoCS


CComMultiThreadModelNoCS::CriticalSection

This typdef references the CComFakeCriticalSection class.

Syntax

typedef CComFakeCriticalSection CriticalSection

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModelNoCS Overview, CComMultiThreadModelNoCS TypeDefs, CComObjectThreadModel , CComGlobalsThreadModel, CComMultiThreadModelNoCS::ThreadModelNoCS


CComMultiThreadModelNoCS::ThreadModelNoCS

This typdef references the CComMultiThreadModelNoCS class.

Syntax

typedef CComMultiThreadModelNoCS ThreadModelNoCS

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComMultiThreadModelNoCS Overview, CComMultiThreadModelNoCS TypeDefs, CComObjectThreadModel , CComGlobalsThreadModel


CComObject

The CComObject class implements IUnknown for a nonaggregated object.

Syntax

template< class Base >

class CComObject : public Base

Parameters

The Base parameter is your class.

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObject Methods, CComObjectRoot , CComObjectRootEx


CComObject Methods

Class Methods |
CComObject | Constructor.
CreateInstance | Creates an instance of a CComObject.
IUnknown Methods |
AddRef | Increments the reference count.
QueryInterface | Retrieves a pointer to the requested interface.
Release | Decrements the reference count.

See Also

CComObject Overview


CComObject::AddRef

This method increments the reference count on the object.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObject Overview, CComObject Methods, CComObject::Release


CComObject::CComObject

The class constructor.

Syntax

CComObject( void* = NULL );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObject Overview, CComObject Methods


CComObject::CreateInstance

This method creates a new CComObject object.

Syntax

static HRESULT CreateInstance( CComObject <Base>** pp);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObject Overview, CComObject Methods


CComObject::QueryInterface

This method retrieves a pointer to the requested interface.

Syntax

HRESULT QueryInterface( REFIID iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObject Overview, CComObject Methods


CComObject::Release

This method decrements the reference count on the object.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObject Overview, CComObject Methods, CComObject::AddRef


CComObjectGlobal

The CComObjectGlobal class manages a reference count on the module containing the Base object.

Syntax

template< class Base >

class CComObjectGlobal : public Base

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectGlobal Methods, CComObjectGlobal Data Members, CComObject , CComAggObject


CComObjectGlobal Methods

Class Methods |
CComObjectGlobal | Constructor.
IUnknown Methods |
AddRef | Increments the reference count.
QueryInterface | Retrieves a pointer to the requested interface.
Release | Decrements the reference count.

See Also

CComObjectGlobal Overview, CComObjectGlobal Data Members


CComObjectGlobal::AddRef

This method increments the reference count on the Base object.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectGlobal Overview, CComObjectGlobal Methods, CComObjectGlobal::Release , CComModule::Lock


CComObjectGlobal::CComObjectGlobal

The constructor constructs a CComObjectGlobal instance.

Syntax

CComObjectGlobal( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectGlobal Overview, CComObjectGlobal Methods


CComObjectGlobal::QueryInterface

This method requests a pointer to a specified interface.

Syntax

HRESULT QueryInterface( REFIID iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectGlobal Overview, CComObjectGlobal Methods


CComObjectGlobal::Release

This method decrements the reference count on the Base object.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectGlobal Overview, CComObjectGlobal Methods


CComObjectGlobal Data Members

CComObjectGlobal Data Members |
m_hResFinalConstruct | Contains the HRESULT returned during construction of the CComObjectGlobal object

See Also

CComObjectGlobal Overview, CComObjectGlobal Methods


CComObjectGlobal::m_hResFinalConstruct

This data member contains the HRESULT returned during construction of the CComObjectGlobal object.

Syntax

HRESULT m_hResFinalConstruct;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectGlobal Overview, CComObjectGlobal Data Members, CComObjectRootEx::FinalConstruct


CComObjectNoLock

The CComObjectNoLock class is similar to CComObject, but it does not increment the module lock count in the constructor.

Syntax

template< class Base >

class CComObjectNoLock : public Base

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectNoLock Methods, CComObject


CComObjectNoLock Methods

Class Methods |
CComObjectNoLock | Constructor.
IUnknown Methods |
AddRef | Increments the reference count.
QueryInterface | Retrieves a pointer to the requested interface.
Release | Decrements the reference count.

See Also

CComObjectNoLock Overview


CComObjectNoLock::AddRef

This method increments the reference count on the object.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectNoLock Overview, CComObjectNoLock Methods


CComObjectNoLock::CComObjectNoLock

The class constructor.

Syntax

CComObjectNoLock( void* = NULL );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectNoLock Overview, CComObjectNoLock Methods


CComObjectNoLock::QueryInterface

This method returns a pointer to the requested interface.

Syntax

HRESULT QueryInterface( REFIID iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectNoLock Overview, CComObjectNoLock Methods


CComObjectNoLock::Release

This method decrements the reference count on the object.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectNoLock Overview, CComObjectNoLock Methods


CComObjectRoot

TheCComObjectRoot class is a typedef of CCoObjectRootEx, templatized on the default threading model of the server.

Syntax

typedef CComObjectRootEx <CComObjectThreadModel> CComObjectRoot;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx , CComObject, CComPolyObject


CComObjectRootEx

The CComObjectRootEx class handles object reference count management for both aggregated and non-aggregated objects.

Syntax

template< class ThreadModel >

class CComObjectRootEx : public CComObjectRootBase

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Methods, CComObjectRootEx Data Members, CComObject , CComPolyObject


CComObjectRootEx Methods

Class Methods |
CComObjectRootEx | Constructor.
InternalAddRef | Increments the reference count for a non-aggregated object
InternalQueryInterface | Delegates to the IUnknown of a non-aggregated object
InternalRelease | Decrements the reference count for a non-aggregated object
Lock | If the thread model is multi-threaded, this function obtains ownership of a critical section object
Unlock | If the thread model if multi-threaded, releases ownership of a critical section object
CComObjectRootBase Methods |
FinalConstruct | Override in your class to create any aggregated objects
FinalRelease | Override in your class to release any aggregated objects
OuterAddRef | Increments the reference count for an aggregated object
OuterQueryInterface | Delegates to the outer IUnknown of an aggregated object
OuterRelease | Decrements the reference count for an aggregated object

See Also

CComObjectRootEx Overview, CComObjectRootEx Data Members


CComObjectRootEx::CComObjectRootEx

The class constructor.

Syntax

CComObjectRootEx( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods


CComObjectRootEx::FinalConstruct

Override in your class to create any aggregated objects.

Syntax

HRESULT FinalConstruct( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::FinalRelease


CComObjectRootEx::FinalRelease

Override in your class to release any aggregated objects.

Syntax

void FinalRelease( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::FinalConstruct


CComObjectRootEx::InternalAddRef

This method increments the reference count for a non-aggregated object.

Syntax

ULONG InternalAddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::InternalRelease


CComObjectRootEx::InternalQueryInterface

This method delegates to the IUnknown of a non-aggregated object.

Syntax

HRESULT InternalQueryInterface( void* pThis, const _ATL_INTMAP_ENTRY* pEntries, REFIiD iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::InternalAddRef , CComObjectRootEx::InternalRelease


CComObjectRootEx::InternalRelease

This method decrements the reference count for a non-aggregated object.

Syntax

ULONG InternalRelease( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::InternalAddRef


CComObjectRootEx::Lock

If the thread model is multi-threaded, this function obtains ownership of a critical section object.

Syntax

void Lock( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::Unlock , CComObjectRootEx::m_critsec


CComObjectRootEx::OuterAddRef

This method increments the reference count for an aggregated object.

Syntax

ULONG OuterAddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::OuterRelease , CComObjectRootEx::OuterQueryInterface


CComObjectRootEx::OuterQueryInterface

This method delegates to the outer IUnknown of an aggregated object.

Syntax

HRESULT OuterQueryInterface( REFIID iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::OuterAddRef , CComObjectRootEx::OuterRelease


CComObjectRootEx::OuterRelease

This method decrements the reference count for an aggregated object.

Syntax

ULONG OuterRelease( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::OuterAddRef , CComObjectRootEx::OuterQueryInterface


CComObjectRootEx::Unlock

If the thread model is multi-threaded, this function releases ownership of a critical section object.

Syntax

void Unlock( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods, CComObjectRootEx::Lock , CComObjectRootEx::m_critsec


CComObjectRootEx Data Members

Data Members |
m_critsec | A CComAutoCriticalSection object or CComFakeCriticalSection object, depending on the thread model.
m_dwRef | Part of a union with m_pOuterUnknown. Used when the object is not aggregated to hold the reference count.
m_pOuterUnknown | Part of a union with m_dwRef. Used when the object is aggregated to hold a pointer to the outer IUnknown.

See Also

CComObjectRootEx Overview, CComObjectRootEx Methods


CComObjectRootEx::m_critsec

A CComAutoCriticalSection object or CComFakeCriticalSection object, depending on the thread model.

Syntax

_CritSec m_critsec;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Data Members, CComObjectRootEx::Lock , CComObjectRootEx::Unlock


CComObjectRootEx::m_dwRef

Part of a union with m_pOuterUnknown. Used when the object is not aggregated to hold the reference count.

Syntax

long m_dwRef;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Data Members, CComObjectRootEx::m_pOuterUnknown


CComObjectRootEx::m_pOuterUnknown

Part of a union with m_dwRef. Used when the object is aggregated to hold a pointer to the outer IUnknown.

Syntax

IUnknown* m_pOuterUnknown;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectRootEx Overview, CComObjectRootEx Data Members, CComObjectRootEx::m_dwRef


CComObjectStack

The CComObjectStack clsss is used to create a temporary COM object and provide it with a skeletal implementation of IUnknown.

Syntax

template< class Base >

class CComObjectStack : public Base

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectStack Methods, CComObjectStack Data Members, CComAggObject , CComObject, CComObjectGlobal


CComObjectStack Methods

Class Methods |
CComObjectStack | Constructor.
IUnknown Methods |
AddRef | Returns zero. In debug mode, calls _ASSERTE
QueryInterface | Returns E_NOINTERFACE. In debug mode, calls_ASSERTE.
Release | Returns zero. In debug mode, calls_ASSERTE.

See Also

CComObjectStack Overview, CComObjectStack Data Members


CComObjectStack::AddRef

This method returns zero. In debug mode, it calls _ASSERTE.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectStack Overview, CComObjectStack Methods


CComObjectStack::CComObjectStack

This is the class constructor for CComObjectStack.

Syntax

CComObjectStack( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectStack Overview, CComObjectStack Methods, CComObjectRootEx::FinalConstruct


CComObjectStack::QueryInterface

This method returns E_NOINTERFACE. In debug mode, it calls_ASSERTE

Syntax

HRESULT QueryInterface( REFIID iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectStack Overview, CComObjectStack Methods


CComObjectStack::Release

This method returns zero. In debug mode, it calls_ASSERTE.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectStack Overview, CComObjectStack Methods


CComObjectStack Data Members

Data Members |
m_hResFinalConstruct | Contains the HRESULT returned during construction of the CComObjectStack object.

See Also

CComObjectStack Overview, CComObjectStack Methods


CComObjectStack::m_hResFinalConstruct

This method contains the HRESULT returned during construction of the CComObjectStack object.

Syntax

HRESULT m_hResFinalConstruct;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComObjectStack Overview, CComObjectStack Data Members, CComObjectRootEx::FinalConstruct


CComObjectThreadModel

#if defined(_ATL_SINGLE_THREADED)
typedef CComSingleThreadModel CComObjectThreadModel
#elif defined (_ATL_APARTMENT_THREADED)
typedef CComSingleThreadModel CComObjectThreadModel
#else
typedef CComMultiThreadModel CComObjectThreadModel
#endif

Depending on the threading model used by your application, the typedef name CComObjectThreadModel references either CComSingleThreadModel or CComMultiThreadModel.

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE only supports the single threading and free threading models. It doesn't support the apartment threading model.

See Also

CComObjectRootEx


CComPolyObject

The CComPolyObject class implements IUknown for an aggregated or nonaggregated class. The contained class is your class

Syntax

template< class contained >

class CComPolyObject : public IUknown, public CComObjectRootEx<contained::_ThreadModel::ThreadModelNoCS>

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Methods, CComPolyObject Data Members, CComObjectRootEx


CComPolyObject Methods

Class Methods |
CComPolyObject | Constructor.
FinalConstruct | Performs final initialization of m_contained.
FinalRelease | Performs final destruction of m_contained.
Iunknown Methods |
AddRef | Increments the reference count.
QueryInterface | Retrieves a pointer to the requested interface.
Release | Decrements the reference count.

See Also

CComPolyObject Overview, CComPolyObject Data Members


CComPolyObject::AddRef

This method increments the reference count on the aggregated object.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Overview, CComPolyObject Methods, CComPolyObject::Release


CComPolyObject::CComPolyObject

The constructor initializes the CComContainedObject member, m_contained, and increments the module lock count. The destructor decrements the module lock count.

Syntax

CComPolyObject( void* pv );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Overview, CComPolyObject Methods, CComPolyObject::FinalConstruct , CComPolyObject::FinalRelease


CComPolyObject::FinalConstruct

This method performs any final initialization on the m_contained member, and is called during the final stages of object construction.

Syntax

HRESULT FinalConstruct( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Overview, CComPolyObject Methods, CComObjectRootEx::FinalConstruct , CComPolyObject::FinalRelease


CComPolyObject::FinalRelease

This method frees the m_contained member, and is called during object destruction.

Syntax

void FinalRelease( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Overview, CComPolyObject Methods, CComPolyObject::FinalConstruct , CComObjectRootEx::FinalRelease


CComPolyObject::QueryInterface

This method retrieves a pointer to the requested interface.

Syntax

HRESULT QueryInterface( REFIID iid, void** ppvObject);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Overview, CComPolyObject Methods


CComPolyObject::Release

This method decrements the reference count on the aggregated object.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Overview, CComPolyObject Methods, CComPolyObject::AddRef


CComPolyObject Data Members

Data Members |
m_contained | Delegates IUnknown calls to the outer unknown if the object is aggregated, and to the IUnknown of the object if it is not aggregated.

See Also

CComPolyObject Overview, CComPolyObject Methods


CComPolyObject::m_contained

Delegates IUnknown calls to the outer unknown if the object is aggregated, and to the IUnknown of the object if it is not aggregated.

Syntax

CComContainedObject< contained > m_contained;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPolyObject Overview, CComPolyObject Data Members


CComPtr

A COM interface specifying the type of pointer to be stored.

ATL uses CComPtr and CComQIPtr to manage COM interface pointers. Both classes perform automatic reference counting through calls to AddRef and Release. Overloaded operators handle pointer operations. CComQIPtr additionally supports automatic querying of interfaces though QueryInterface.

Syntax

template< class T >

class CComPtr

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Methods, CComPtr Operators, CComPtr Data Members, CComPtr::CComPtr , CComQIPtr::CComQIPtr


CComPtr Methods

Class Methods |
CComPtr | Constructor. Initializes the member pointer.
Iunknown Methods |
Release | Decrements the reference count.

See Also

CComPtr Overview, CComPtr Operators, CComPtr Data Members


CComPtr::CComPtr

This method is the constructor for CComPtr.

Syntax

ULONG CComPtr( VOID );

ULONG CComPtr( T* lp );

ULONG CComPtr( const CComPtr< T >& lp );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Methods


CComPtr::Release

Calls IUnknown::Release through p and sets p to NULL.

Syntax

ULONG Release( VOID );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Methods


CComPtr Operators

Operators |
operator T* | Converts a CComPtr object to a T*
operator * | Returns the dereferenced value of the member pointer.
operator & | Returns the address of the member pointer
operator -> | Returns the member pointer.
operator = | Assigns a pointer to the member pointer
operator ! | Returns TRUE or FALSE depending on whether or not the member pointer is NULL

See Also

CComPtr Overview, CComPtr Methods, CComPtr Data Members


CComPtr::operator T*

Converts a CComPtr object to a T*.

Syntax

operator T*( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Operators


CComPtr::operator *

Returns the dereferenced value of the interface pointer, p.

Syntax

T& operator *( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Operators


CComPtr::operator &

Returns the address of the interface pointer, p.

Syntax

T** operator &( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Operators


CComPtr::operator ->

Returns the interface pointer, p.

Syntax

T* operator ->( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Operators


CComPtr::operator =

Assigns a pointer.

Syntax

T* operator =( T* lp );

T* operator =( const CComPtr< T >& lp );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Operators


CComPtr::operator !

Returns true if p is NULL; otherwise, false.

Syntax

BOOL operator !( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Operators


CComPtr Data Members

Data Members |
p | The manage COM interface pointer of type T*

See Also

CComPtr Overview, CComPtr Methods, CComPtr Operators


CComPtr::p

Points to the specified COM interface.

Syntax

T* p;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComPtr Overview, CComPtr Data Members


CComQIPtr

A COM interface specifying the type of pointer to be stored. CComQIPtr supports automatic querying of interfaces though QueryInterface.

Syntax

template< class T const IID* piid>

class CComQIPtr

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Methods, CComQIPtr Operators, CComQIPtr Data Members, CComPtr::CComPtr , CComQIPtr::CComQIPtr


CComQIPtr Methods

Class Methods |
CComQiPtr | Constructor. Initializes the member pointer.
Iunknown Methods |
Release | Decrements the reference count.

See Also

CComQIPtr Overview, CComQIPtr Operators, CComQIPtr Data Members


CComQIPtr::CComQIPtr

This method is the constructor for CComQlPtr.

Syntax

ULONG CComQIPtr( VOID );

ULONG CComQIPtr( T* lp );

ULONG CComQIPtr( const CComQIPtr< T >& lp );

ULONG CComQIPtr( IUnknown* lp );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Methods


CComQIPtr::Release

Calls IUnknown::Release through p and sets p to NULL.

Syntax

ULONG Release( VOID );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Methods


CComQIPtr Operators

CComQPtl Operators |
operator T* | Converts a CComPtr object to a T*
operator * | Returns the dereferenced value of the member pointer.
operator & | Returns the address of the member pointer
operator -> | Returns the member pointer.
operator = | Assigns a pointer to the member pointer
operator ! | Returns TRUE or FALSE depending on whether or not the member pointer is NULL.

See Also

CComQIPtr Overview, CComQIPtr Methods, CComQIPtr Data Members


CComQIPtr::operator T*

Converts a CComQIPtr object to a T*.

Syntax

operator T*( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Operators


CComQIPtr::operator *

Returns the dereferenced value of the interface pointer, p.

Syntax

T& operator *( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Operators


CComQIPtr::operator &

Returns the address of the interface pointer, p.

Syntax

T** operator &( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Operators


CComQIPtr::operator ->

Returns the interface pointer, p.

Syntax

T* operator ->( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Operators


CComQIPtr::operator =

Assigns a pointer.

Syntax

T* operator =( T* lp );

T* operator =( const CComQIPtr< T >& lp );

T* operator =( IUnknown* lp );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Operators


CComQIPtr::operator !

Returns true if p is NULL; otherwise, false.

Syntax

BOOL operator !( VOID )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Operators


CComQiPtr Data Members

Data Members |
p | The manage COM interface pointer of type T*

See Also

CComQIPtr Overview, CComQIPtr Methods, CComQIPtr Operators


CComQIPtr::p

Points to the specified COM interface.

Syntax

T* p;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComQIPtr Overview, CComQIPtr Data Members


CComSingleThreadModel

The CComSingleThreadModel provides methods for incrementing and decrementing the value of a variable.

Syntax

class CComSingleThreadModel

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComSingleThreadModel Methods, CComSingleThreadModel TypeDefs, CComMultiThreadModel , CComMultiThreadModelNoCS


CComSingleThreadModel Methods

Class Methods |
Decrement | Decrements a variable.
Increment | Increments a variable

See Also

CComSingleThreadModel Overview, CComSingleThreadModel TypeDefs


CComSingleThreadModel::Decrement

This method decrements the value of the specified variable. It is not thread-safe.

Syntax

static ULONG Decrement( LPLONG p);

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComSingleThreadModel Overview, CComSingleThreadModel Methods, CComSingleThreadModel::Increment


CComSingleThreadModel::Increment

This method increments the value of the specified variable. It is not thread-safe.

Syntax

static ULONG Increment( LPLONG p);

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComSingleThreadModel Overview, CComSingleThreadModel Methods, CComSingleThreadModel::Decrement


CComSingleThreadModel TypeDefs

CComSingleThreadModel TypeDefs |
AutoCriticalSection | References class CComFakeCriticalSection
CriticalSection | References class CComFakeCriticalSection
ThreadModelNoCS | References class CComSingleThreadModel

See Also

CComSingleThreadModel Overview, CComSingleThreadModel Methods


CComSingleThreadModel::AutoCriticalSection

When using CComSingleThreadModel, the typedef name AutoCriticalSection references class CComFakeCriticalSection.

Syntax

typedef CComFakeCriticalSection AutoCriticalSection

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComSingleThreadModel Overview, CComSingleThreadModel TypeDefs, CComSingleThreadModel::CriticalSection , CComFakeCriticalSection


CComSingleThreadModel::CriticalSection

When using CComSingleThreadModel, the typedef name CriticalSection references class CComFakeCriticalSection..

Syntax

typedef CComFakeCriticalSection CriticalSection

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComSingleThreadModel Overview, CComSingleThreadModel TypeDefs, CComSingleThreadModel::CriticalSection , CComFakeCriticalSection


CComSingleThreadModel::ThreadModelNoCS

When using CComSingleThreadModel, the typedef name ThreadModelNoCS simply references class CComSingleThreadModel.

Syntax

typedef CCom SingleThreadModel ThreadModelNoCS

At a Glance

Header file: Atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComSingleThreadModel Overview, CComSingleThreadModel TypeDefs, CComMultiThreadModel , CComMultiThreadModelNoCS


CComTearOffObject

CComTearOffObject implements a tear-off interface as a separate object that is instantiated only when that interface is queried for. The tear-off is deleted when its reference count becomes zero. Typically, you build a tear-off interface for an interface that is rarely used, since using a tear-off saves a vtable pointer in all the instances of your main object.

Syntax

template< class Base >

class CComTearOffObject : public Base

Parameters

Base is a tear-off class, derived from CComTearOffObjectBase, and the interfaces that the tear-off object supports. It is responsible for handling the reference count and QueryInterface.

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComTearOffObject Methods, CComTearOffObject Data Members


CComTearOffObject Methods

Class Methods |
CComTearOffObject | Constructor.
CComTearOffObjectBase | Constructor for the CComTearOffObjectBase class.
IUnknown Methods |
AddRef | Increments the reference count.
QueryInterface | Retrieves a pointer to the requested interface.
Release | Decrements the reference count.

See Also

CComTearOffObject Overview, CComTearOffObject Data Members


CComTearOffObject::AddRef

This method increments the reference count.

Syntax

ULONG AddRef( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComTearOffObject Overview, CComTearOffObject Methods


CComTearOffObject::QueryInterface

This method returns a pointer to the requested interface on either your tear-off class, or the owner class.

Syntax

HRESULT QueryInterface( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation


CComTearOffObject::Release

This method decrements the reference count for a CComTearOffObject and destroys it.

Syntax

ULONG Release( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComTearOffObject Overview, CComTearOffObject Methods


CComTearOffObject::CComTearOffObject

The constructor for the CComTearOffObject class.

Syntax

CComTearOffObject( void* p);

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComTearOffObject Overview, CComTearOffObject Methods


CComTearOffObject::CComTearOffObjectBase

The constructor for the base class.

Syntax

CComTearOffObjectBase( );

At a Glance

Header file: | Atlcom.h
Platforms: |
Versions: | 2.0 and later
Complete documentation: | Visual C++ documentation

See Also

CComTearOffObject Overview, CComTearOffObject Methods


CComTearOffObject Data Members

CComTearOffObject Data Members |
m_pOwner | A pointer to a CComObject derived from the owner class.

See Also

CComTearOffObject Overview, CComTearOffObject Methods


CComTearOffObject::m_pOwner

A pointer to a CComObject derived from the owner class.

Syntax

CComTearOffObject< Owner > m_pOwner;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComTearOffObject Overview, CComTearOffObject Data Members


CComUnkArray

The CComUnkArray holds a fixed number of IUnknown pointers, each an interface on a connection point.

Syntax

template< unsigned int nMaxSize >

class CComUnkArray

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComUnkArray Methods, CComDynamicUnkArray


CComUnkArray Methods

Class Methods |
begin | Returns a pointer to the first Iunknown pointer in the collection
CComUnkArray | Constructor.
end | Returns a pointer to one past the last IUnknown pointer in the collection

See Also

CComUnkArray Overview


CComUnkArray::begin

Returns a pointer to the first IUnknown pointer in the array.

Syntax

IUnknown** begin( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComUnkArray Overview, CComUnkArray Methods, CComUnkArray::end


CComUnkArray::CComUnkArray

The constructor for the CComUnkArray class. Sets the collection to hold nMaxSize IUnknown pointers.

Syntax

CComUnkArray( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComUnkArray Overview, CComUnkArray Methods


CComUnkArray::end

Returns a pointer to one past the last IUnknown pointer in the collection.

Syntax

IUnknown** end( );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComUnkArray Overview, CComUnkArray Methods, CComUnkArray::begin


CComVariant

The CComVariant class wraps the VARIANT type. VARIANTS are typically used with Automation.

Syntax

class CComVariant : public tagVARIANT

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Methods, CComVariant Operators, VARIANT


CComVariant Methods

Class Methods |
Attach | Attaches a VARIANT to the CComVariant object
CComVariant | The constructor.
ChangeType | Converts the CComVariant object to a new type
Clear | Clears the CComVariant object
Copy | Copies a VARIANT to the CcomVariant object
Detach | Detaches the underlying VARIANT from the CComVariant object
ReadFromStream | Loads a VARIANT from a stream
WriteToStream | Saves the underlying VARIANT to a stream

See Also

CComVariant Overview, CComVariant Operators


CComVariant::Attach

Attaches a VARIANT to the CComVariant object

Syntax

HRESULT Attach( VARIANT* pSrc);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods, CComVariant::Detach, VARIANT


CComVariant::CComVariant

The CComVariant constructor.

Syntax

CComVariant( );
CComVariant( const CComVariant& varSrc);
CComVariant( const VARIANT& varSrc);
CComVariant( LPCOLESTR lpsz );
CComVariant( LPCSTR lpsz );
CComVariant( BSTR bstrSrc );
CComVariant( bool bSrc );
CComVariant( int nSrc );
CComVariant( BYTE nSrc );
CComVariant( short nSrc );
CComVariant( long nSrc, VARTYPE vtSrc = VT_I4 );
CComVariant( float fltSrc );
CComVariant( double dblSrc );
CComVariant( CY cySrc );
CComVariant( IDispatch* pSrc );
CComVariant( IUnknown* pSrc );

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods, VARIANT, VARTYPE


CComVariant::ChangeType

This method converts the CComVariant object to a new type.

Syntax

HRESULT ChangeType( VARTYPE vtNew, const VARIANT* pSrc = NULL);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods, VARIANT, VARTYPE


CComVariant::Clear

This method clears the CComVariant object.

Syntax

HRESULT Clear( );

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods


CComVariant::Copy

This method copies a VARIANT to the CComVariant object.

Syntax

HRESULT Copy( );

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods, VARIANT


CComVariant::Detach

This method detaches the underlying VARIANT from the CComVariant object.

Syntax

HRESULT Detach( VARIANT* pSrc);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods, CComVariant::Attach, VARIANT


CComVariant::ReadFromStream

This method loads a VARIANT from a stream.

Syntax

HRESULT ReadFromStream( ISTREAM* pStream);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods, CComVariant::WriteToStream


CComVariant::WriteToStream

This method saves the underlying VARIANT to a stream.

Syntax

HRESULT WriteToStream( IStream* pStream);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Methods, CComVariant::ReadFromStream


CComVariant Operators

CComVariant Operators |
operator = | Assigns a value to the CComVariant object
operator == | Indicates whether the CComVariant object equals the specified VARIANT
operator != | Indicates whether the CComVariant object does not equal the specified VARIANT

See Also

CComVariant Overview, CComVariant Methods


CComVariant::operator =

This operator assigns a value to the CComVariant object.

Syntax

CComVariant& operator =(const CComVAriant& varSrc);
CComVariant& operator =(const VARIANT& varSrc);
CComVariant& operator =(LPCOLESTR lpsz);
CComVariant& operator =( LPCSTR lpsz );
CComVariant& operator =( BSTR bstrSrc );
CComVariant& operator =( bool bSrc );
CComVariant& operator =( int nSrc );
CComVariant& operator =( BYTE nSrc );
CComVariant& operator =( short nSrc );
CComVariant& operator =( long nSrc );
CComVariant& operator =( float nSrc );
CComVariant& operator =( double nSrc );
CComVariant& operator =( CY cySrc );
CComVariant& operator =( IDispatch* pSrc );
CComVariant& operator =( IUnknown* pSrc );

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Operators, CComVariant::Copy, VARIANT


CComVariant::operator ==

This operator indicates whether the CComVariant object equals the specified VARIANT.

Syntax

bool operator ==(const VARIANT& varSrc);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Operators, CComVariant::operator != , VARIANT


CComVariant::operator !=

This operator indicates whether or not the CComVariant object does not equal the specified VARIANT.

Syntax

bool operator !=( const VARIANT& varSrc);

At a Glance

Header file: atlbase.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CComVariant Overview, CComVariant Operators, CComVariant::operator == , VARIANT


CContainedWindow

The CContainedWindow class implements a window contained within another object.

Syntax

class CContainedWindow : public CWindow

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE supports a couple of new extended window styles that are not supported by other Windows platforms. It also does not support some of the window styles the desktop platforms support. This means you can't use all the same flags for the dwStyle and dwExStyle parameters to the Create method that you can use on other Windows platforms. Windows CE also doesn't support stand alone menu bars.

See Also

CContainedWindow Methods, CContainedWindow Data Members, CComObject, CContainedWindow::Create


CContainedWindow Methods

Class Methods |
CcontainedWindow | Constructor.
Create | Creates a window
DefWindowProc | Provides default message processing
RegisterWndSuperClass | Registers the window class of the contained window
SubclassWindow | Subclass a window
SwitchMessageMap | Changes which message map is used to process the contained window's messages
UnsubclassWindow | Restores a previously subclassed window
WindowProc | Processes messages sent to the contained window

See Also

CContainedWindow Overveiw, CContainedWindow Data Members


CContainedWindow::CContainedWindow

This constructor for the class.

Syntax

CContainedWindow(LPSTR lpszClassName, CMessageMap* pObject, DWORD dwMsgMapID = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Methods


CContainedWindow::Create

This method creates a window.

Syntax

HWND Create(HWND hWndParent, RECT& rcPos, LPCTSTR szWindowName = NULL, DWORD dwStyle = WS_CHILD | WS_VISIBLE, DWORD dwExStyle = 0, UINT nID = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE doesn't support stand alone menu bars, so the nID parameter must be set to zero, unless you're using it as a child-window identifier.

Windows CE supports the following two new extended window styles.

WS_EX_NOACTIVATE | A top level window created with this style can't be activated. If a child window has this style, tapping it won't cause its top-level parent to be activated. A window that has this style will receive stylus events, but neither it nor its child windows can get the focus.
WS_EX_NOANIMATION | A window created with this style doesn't show animated exploding and imploding rectangles, and doesn't have a button on the taskbar.

Windows CE does not support the following dwExStyle flags.

WS_EX_ACCEPTFILES | WS_EX_LEFTSCROLLBAR
WS_EX_LEFT | WS_EX_MDICHILD
WS_EX_LTRREADING | WS_EX_PALETTEWINDOW
WS_EX_NOPARENTNOTIFY | WS_EX_RIGHTSCROLLBAR
WS_EX_RIGHT | WS_EX_TOOLWINDOW
WS_EX_RTLREADING | WS_EX_TOPMOST
WS_EX_APPWINDOW | WS_EX_TRANSPARENT

Windows CE does not support the following dwStyle flags.

WS_CHILDWINDOW | WS_ICONIC
WS_MAXIMIZE | WS_MAXIMIZEBOX
WS_MINIMIZE | WS_MINIMIZEBOX
WS_OVERLAPPEDWINDOW | WS_POPUPWINDOW
WS_SIZEBOX | WS_THICKFRAME
WS_TILED | WS_TILEDWINDOW

All windows in Windows CE implicitly have the WS_CLIPSIBLINGS and WS_CLIPCHILDREN styles.

See the global function CreateWindow for control styles that Windows CE doesn't support.

See Also

CContainedWindow Overveiw, CContainedWindow Methods


CContainedWindow::DefWindowProc

This method provides default message processing.

Syntax

LRESULT DefWindowProc( UINT uMsg, WPARAM wParam, LPARAM lParam);

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Methods, CContainedWindow::m_pfnSuperWindowProc


CContainedWindow::RegisterWndSuperClass

This method registers the window class of the contained window.

Syntax

ATOM RegisterWndSuperClass( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Methods, CContainedWindow::CContainedWindow


CContainedWindow::SubclassWindow

This method subclass a window.

Syntax

BOOL SubclassWindow( HWND hWnd);

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Methods, CContainedWindow::UnsubclassWindow


CContainedWindow::SwitchMessageMap

This method changes which message map is used to process the contained window's messages.

Syntax

void SwitchMessageMap( DWORD dwMsgMapID);

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Methods, CContainedWindow::m_dwMsgMapID


CContainedWindow::UnsubclassWindow

This method restores a previously subclassed window.

Syntax

HWND UnsubclassWindow( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Methods, CContainedWindow::SubclassWindow


CContainedWindow::WindowProc

This method processes messages sent to the contained window.

Syntax

static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Methods


CContainedWindow Data Members

Data Members |
m_dwMsgMapID | Identifies which message map will process the contained window's messages
m_lpszClassName | Specifies the name of an existing window class on which a new window class will be based
m_pfnSuperWindowProc | Points to the window class's original window procedure
m_pObject | Points to the containing object

See Also

CContainedWindow Overveiw, CContainedWindow Methods


CContainedWindow::m_dwMsgMapID

This data member identifies which message map will process the contained window's message.

Syntax

DWORD m_dwMsgMapID;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Data Members, CContainedWindow::m_pObject


CContainedWindow::m_lpszClassName

This data member specifies the name of an existing window class on which a new window class will be based.

Syntax

LPTSTR m_lpszClassName;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Data Members


CContainedWindow::m_pfnSuperWindowProc

This data member points to the window class's original window procedure.

Syntax

WNDPROC m_pfnSuperWindowProc;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Data Members


CContainedWindow::m_pObject

This data member points to the containing object.

Syntax

CMessageMap* m_pObject;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CContainedWindow Overveiw, CContainedWindow Data Members


CDialogImpl

The CDialogImpl class allows an application to create a modal or modeless dialog box.

Syntax

template< class T >

class CDialogImpl : public CDialogImplBase

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDialogImpl Methods


CDialogImpl Methods

Class Methods |
Create | Creates a modeless dialog box
DoModal | Creates a modal dialog box
CDialogImplBase Methods |
DialogProc | Processes messages sent to the dialog box
EndDialog | Destroys a modal dialog box

See Also

CDialogImpl Overview


CDialogImpl::Create

This method creates a modeless dialog box.

Syntax

HWND Create( HWND hWndParent);

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDialogImpl Overview, CDialogImpl Methods


CDialogImpl::DialogProc

This method processes the messages sent to the dialog box.

Syntax

static BOOL CALLBACK DialogProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDialogImpl Overview, CDialogImpl Methods


CDialogImpl::DoModal

This method creates a modal dialog box.

Syntax

int DoModal( HWND hWndParent = ::GetActiveWindow() );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDialogImpl Overview, CDialogImpl Methods


CDialogImpl::EndDialog

This method destroys a modal dialog box.

Syntax

BOOL EndDialog( int nRetCode);

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDialogImpl Overview, CDialogImpl Methods


CDynamicChain

The CDynamicChain class manages a collection of message maps.

Syntax

class CDynamicChain

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDynamicChain Methods, CWindowImpl


CDynamicChain Methods

Class Methods |
CallChain | Directs a Windows message to another object's message map.
RemoveChainEntry | Removes a message map entry from the collection
SetChainEntry | Adds a message map entry to the collection or modifies an existing entry

See Also

CDynamicChain Overview


CDynamicChain::CallChain

This method directs a Windows message to another object's message map.

Syntax

BOOL CallChain( DWORD dwChainID, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDynamicChain Overview, CDynamicChain Methods, CDynamicChain::SetChainEntry


CDynamicChain::RemoveChainEntry

This method removes a message map entry from the collections.

Syntax

BOOL RemoveChainEntry( DWORD dwChainID );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDynamicChain Overview, CDynamicChain Methods, CDynamicChain::SetChainEntry


CDynamicChain::SetChainEntry

This method adds a message map entry to the collection or modifies an existing entry.

Syntax

BOOL SetChainEntry( DWORD dwChainID, CMessageMap* pObject, DWORD dwMsgMapID = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CDynamicChain Overview, CDynamicChain Methods, CDynamicChain::CallChain , CDynamicChain::RemoveChainEntry


CFirePropNotifyEvent

CFirePropNotifyEvent notifes the container's sink that a control property has changed or is about to change.

Syntax

class CFirePropNotifyEvent

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CFirePropNotifyEvent Methods


CFirePropNotifyEvent Methods

CFirePropNotifyEvent Methods |
FireOnChanged | Notifies the container's sink that a control property has changed.
FireOnRequestEdit | Notifies the container's sink that a control property is about to change.

See Also

CFirePropNotifyEvent Overview


CFirePropNotifyEvent::FireOnChanged

This method notifies all connected IPropertyNotifySink interfaces (on every connection point of the object) that the specified object property has changed. This function is safe to call even if your control doesn't support connection points.

Syntax

HRESULT FireOnChanged( IUnknown* pUnk, DISPID dispID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CFirePropNotifyEvent Overview, CFirePropNotifyEvent Methods, CFirePropNotifyEvent::FireOnRequestEdit , CComControl::FireOnChanged


CFirePropNotifyEvent::FireOnRequestEdit

This method notifies all connected IPropertyNotifySink interfaces (on every connection point of the object) that the specified object property is about to change. This function is safe to call even if your control doesn't support connection points.

Syntax

HRESULT FireOnRequestEdit( IUnknown* pUnk, DISPID dispID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CFirePropNotifyEvent Overview, CFirePropNotifyEvent Methods, CFirePropNotifyEvent::FireOnChanged , CComControl::FireOnRequestEdit


CMessageMap

CMessageMap is an abstract base class that allows an object's message maps to be accessed by another object. In order for an object to expose its message maps, its class must derive from CMessageMap.

ATL uses CMessageMap to support contained windows and dynamic message map chaining.

Syntax

class CMessageMap

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CMessageMap Methods, CDynamicChain


CMessageMap Methods

CMessageMap Methods |
ProcessWindowMessage | Accesses a message map in the CMessageMap-derived class.

See Also

CMessageMap Overview


CMessageMap::ProcessWindowMessage

This method accesses the message map identified by dwMsgMapID in a CMessageMap-derived class. Called by the window procedure of a CContainedWindow object or of an object that is dynamically chaining to the message map.

Syntax

virtual BOOL ProcessWindowMessage( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID ) = 0;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CMessageMap Overview, CMessageMap Methods


CRegKey

CRegKey provides methods for manipulating values in the system registry. The registry contains an installation-specific set of definitions for system components, such as software version numbers, logical-to-physical mappings of installed hardware, and COM objects.

Syntax

class CRegKey

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Methods, CRegKey Operators, CRegKey Data Members,


CRegKey Methods

CRegKey Methods |
Attach | Attaches a registry key handle to the CRegKey object.
Close | Releases m_hKey.
Create | Creates or opens the specified key.
CRegKey | Constructor.
DeleteSubKey | Deletes the specified key.
DeleteValue | Deletes a value field of the key identified by m_hKey.
Detach | Detaches m_hKey from the CRegKey object.
Open | Opens the specified key.
QueryValue | Retrieves the data for a specified value field.
RecurseDeleteKey | Deletes the specified key and explicitly deletes all subkeys.
SetKeyValue | Stores data in a specified value field of a specified key.
SetValue | Stores data in a specified value field.

See Also

CRegKey Overview, CRegKey Operators, CRegKey Data Members


CRegKey::Attach

This method attaches an HKEY to the CRegKey object by setting the m_hKey member handle to hKey.

Syntax

void Attach( HKEY hKey );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::Detach


CRegKey::Close

This method releases the m_hKey member handle and sets it to NULL.

Syntax

LONG Close( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::Open , CRegKey::m_hKey


CRegKey::Create

This method creates the specified key if it does not exist as a subkey of hKeyParent. Otherwise, Create opens the key.

Syntax

LONG Create( HKEY hKeyParent, LPCTSTR lpszKeyName, LPTSTR lpszClass = REG_NONE, DWORD dwOptions = REG_OPTION_NON_VOLATILE, REGSAM samDesired = KEY_ALL_ACCESS, LPSECURITY_ATTRIBUTES lpSecAttr = NULL, LPDWORD lpdwDisposition = NULL );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::Open , CRegKey::m_hKey


CRegKey::CRegKey

This method is the the constructor. Sets the m_hKey member handle to NULL. The destructor releases m_hKey.

Syntax

CRegKey( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::m_hKey


CRegKey::DeleteSubKey

This method removes the specified key from the registry.

Syntax

LONG DeleteSubKey( LPCTSTR lpszSubKey );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::DeleteValue , CRegKey::m_hKey


CRegKey::DeleteValue

This method removes a value field from m_hKey.

Syntax

LONG DeleteValue( LPCTSTR lpszValue );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::DeleteSubKey , CRegKey::m_hKey


CRegKey::Detach

This method detaches the m_hKey member handle from the CRegKey object and sets m_hKey to NULL.

Syntax

HKEY Detach( );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::Attach , CRegKey::m_hKey


CRegKey::Open

This method opens the specified key and sets m_hKey to the handle of this key. If the lpszKeyName parameter is NULL or points to an empty string, Open opens a new handle of the key identified by hKeyParent, but does not close any previously opened handle.

Syntax

LONG Open( HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired = KEY_ALL_ACCESS );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::Close , CRegKey::m_hKey


CRegKey::QueryValue

This method retrieves the data for the specified value field of m_hKey . The first version of QueryValue allows you to retrieve numerical data. The second version allows you to retrieve string data.

Syntax

LONG QueryValue( DWORD& dwValue, LPCTSTR lpszValueName );

LONG QueryValue( LPTSTR szValue, LPCTSTR lpszValueName, DWORD* pdwCount )

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::m_hKey


CRegKey::RecurseDeleteKey

This method removes the specified key from the registry and explicitly removes any subkeys.

Syntax

LONG RecurseDeleteKey( LPCTSTR lpszKey );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::m_hKey


CRegKey::SetKeyValue

This method creates or opens the lpszKeyName key and stores the lpszValue data in the lpszValueName value field.

Syntax

LONG SetKeyValue( LPCTSTR lpszKeyName, LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::SetValue , CRegKey::m_hKey


CRegKey::SetValue

This method stores data in the specified value field of an open registry key. The first two versions of SetValue use m_hKey as the open key. The third version allows you to create or open a subkey of hKeyParent, and then set the value field of the subkey.

Syntax

LONG SetValue( DWORD dwValue, LPCTSTR lpszValueName );

LONG SetValue( LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL );

LONG SetValue( HKEY hKeyParent, LPCTSTR lpszKeyName, LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL );

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Methods, CRegKey::SetKeyValue , CRegKey::m_hKey


CRegKey Operators

CRegKey Methods |
operatorHKey | Casts a CRegKey object to an HKEY.

See Also

CRegKey Overview, CRegKey Methods, CRegKey Data Members


CRegKey::operator HKEY

This operator casts a CRegKey object to an HKEY.

Syntax

operator HKEY( ) const;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Operators


CRegKey Data Members

CRegKey Data Members |
m_hKey | Contains a handle of the registry key associated with the CRegKey object.

See Also

CRegKey Overview, CRegKey Methods, CRegKey Operators


CRegKey::m_hKey

This data member contains a handle of the registry key associated with the CRegKey object.

Syntax

HKEY m_hKey;

At a Glance

Header file: Atlbase.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CRegKey Overview, CRegKey Data Members


CStockPropImpl

CStockPropImpl implements every stock property you can choose from the Stock Properties tab in the ATL Object Wizard. CStockPropImpl automatically creates a data member in your control class for each property, creates put and get methods for each property, and adds code to notify and synchronize with the container when any property changes.

Syntax

template < class T, class InterfaceName, const IID* piid, const GUID* plibid >
class CStockPropImpl : IDispatchImpl< InterfaceName, piid, plibid >

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

In Windows CE, the CStockPropImpl class doesn't implement the put_MouseIcon or put_Picture methods.

See Also

CComControl , CWindow


CWindow

CWindow provides the base functionality for manipulating a window in ATL. Many of the CWindow methods are simply wrappers for Win32 API functions.

class CWindow

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

ATL for Windows CE supports the following CWindow methods but, because of inherent differences between the Windows CE and the desktop Windows platforms, these methods don't support the full range of behavior they do on the desktop versions of Windows.

CWindow::CreateCaret

CWindow::GetDlgItem

CWindow::GetDlgItemInt

CWindow::MessageBox

CWindow::ScrollWindowEx

CWindow::SetDlgItemInt

CWindow::SetFocus

CWindow::ShowWindow

ATL for Windows CE doesn't support the following CWindow methods.

ArrangeIconicWindows | ChangeClipboardChain
ChildWindowFromPointEx | DlgDirList
DlgDirListComboBox | DlgDirSelect
DlgDirSelectComboBox | DragAcceptFiles
EnableScrollBar | FlashWindow
GetDCEx | GetDescendantWindow
GetHotKey | GetLastActivePopup
GetMenu | GetSystemMenu
GetTopWindow | GetWindowContextHelpId
GetWindowPlacement | GetWindowWord
HiliteMenuItem | InvalidateRgn
IsIconic | IsZoomed
LockWindowUpdate | Print
PrintClient | RedrawWindow
ScrollWindow | SendMessageToDescendants
SetClipboardViewer | SetHotKey
SetMenu | SetWindowContextHelpId
SetWindowPlacement | SetWindowWord
ShowOwnedPopups | ShowScrollBar
ValidateRgn | WinHelp

See Also

CWindow Methods, CWindow Operators, CWindow Data Members


CWindow Methods

Alert Methods
MessageBox | Displays a message box.
Attribute Methods |
GetExStyle | Retrieves the extended window styles.
GetStyle | Retrieves the window styles.
GetWindowLong | Retrieves a 32-bit value at a specified offset into the extra window memory.
ModifyStyle | Modifies the window styles.
ModifyStyleEx | Modifies the extended window styles.
SetWindowLong | Sets a 32-bit value at a specified offset into the extra window memory.
Caret Methods |
CreateCaret | Creates a new shape for the system caret.
CreateGrayCaret | Creates a gray rectangle for the system caret.
CreateSolidCaret | Creates a solid rectangle for the system caret.
HideCaret | Hides the system caret.
ShowCaret | Displays the system caret.
Clipboard Methods |
OpenClipboard | Opens the Clipboard
Construction, Destruction, and Initialization |
Attach | Attaches a window to the CWindow object.
CWindow | Constructor.
DestroyWindow | Destroys the window associated with the CWindow object
Detach | Detaches the window from the CWindow object
Coordinate Mapping Methods |
ClientToScreen | Converts client coordinates to screen coordinates.
MapWindowPoints | Converts a set of points from the window's coordinate space to the coordinate space of another window.
ScreenToClient | Converts screen coordinates to client coordinates.
Dialog Box Item Methods |
CheckDlgButton | Changes the check state of the specified button.
CheckRadioButton | Checks the specified radio button.
GetDlgItemInt | Translates a control's text to an integer.
GetDlgItemText | Retrieves a control's text.
GetNextDlgGroupItem | Retrieves the previous or next control within a group of controls.
GetNextDlgTabItem | Retrieves the previous or next control having the WS_TABSTOP style.
IsDlgButtonChecked | Determines the check state of the button.
SendDlgItemMessage | Sends a message to a control.
SetDlgItemInt | Changes a control's text to the string representation of an integer value.
SetDlgItemText | Changes a control's text.
Font Methods |
GetFont | Retrieves the window's current font.
SetFont | Changes the window's current font.
Icon Methods |
GetIcon | Retrieves the window's large or small icon
SetIcon | Changes the window's large or small icon.
Message Methods |
PostMessage | Places a message in the message queue associated with the thread that created the window. Returns without waiting for the thread to process the message.
SendMessage | Sends a message to the window and does not return until the window procedure has processed the message.
SendNotifyMessage | Sends a message to the window. If the window was created by the calling thread, SendNotifyMessage does not return until the window procedure has processed the message. Otherwise, it returns immediately.
Scrolling Methods |
GetScrollPos | Retrieves the position of the scroll box.
GetScrollRange | Retrieves the scroll bar range.
ScrollWindowEx | Scrolls the specified client area with additional features.
SetScrollPos | Changes the position of the scroll box.
SetScrollRange | Changes the scroll bar range.
Timer Methods |
KillTimer | Destroys a timer event
SetTimer | Creates a timer event
Update and Painting Methods |
BeginPaint | Prepares the window for painting
DrawMenuBar | Redraws the menu bar
EndPaint | Marks the end of painting
GetDC | Retrieves a device context for the client area
GetUpdateRect | Retrieves the coordinates of the smallest rectangle that completely encloses the update region.
GetUpdateRgn | Retrieves the update region and copies it into a specified region.
GetWindowDC | Retrieves a device context for the entire window.
Invalidate | Invalidates the entire client area.
InvalidateRect | Invalidates the client area within the specified rectangle.
IsWindowVisible | Determines the window's visibility state.
ReleaseDC | Releases a device context.
SetRedraw | Sets or clears the redraw flag.
ShowWindow | Sets the window's show state.
UpdateWindow | Updates the client area.
ValidateRect | Validates the client area within the specified rectangle.
Window Access Methods |
ChildWindowFromPoint | Retrieves the child window containing the specified point
GetParent | Retrieves the immediate parent window
GetTopLevelParent | Retrieves the top-level parent or owner window
GetTopLevelWindow | Retrieves the top-level owner window
GetWindow | Retrieves the specified window
IsChild | Determines whether the specified window is a child window
SetParent | Changes the parent window
Window Size and Position Methods |
BringWindowToTop | Brings the window to the top of the Z order
CenterWindow | Centers the window against a given window
GetClientRect | Retrieves the coordinates of the client area
GetWindowRect | Retrieves the window's bounding dimensions
MoveWindow | Changes the window's size and position
SetWindowPos | Sets the size, position, and Z order
Window State Methods |
EnableWindow | Enables or disables input
IsWindowEnabled | Determines whether the window is enabled for input
SetActiveWindow | Activates the window
SetCapture | Sends all subsequent mouse input to the window
SetFocus | Sets the input focus to the window
Window Text Methods |
GetWindowText | Retrieves the window's text
GetWindowTextLength | Retrieves the length of the window's text
SetWindowText | Changes the window's text
Window Tree Access Methods |
GetDlgCtrlID | Retrieves the window's identifier (for child windows only)
GetDlgItem | Retrieves the window's identifier (for child windows only)
SetDlgCtrlID | Changes the window's identifier

See Also

CWindow Overview, CWindow Operators, CWindow Data Members


CWindow::Attach

This method attaches the window identified by hWndNew to the CWindow object.

Syntax

void Attach( HWND hWndNew );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::Detach


CWindow::BeginPaint

This method prepares the window for painting.

Syntax

HDC BeginPaint( LPPAINTSTRUCT lpPaint );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::EndPaint


CWindow::BringWindowToTop

This method brings the window to the top of the Z order.

Syntax

BOOL BringWindowToTop( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::MoveWindow , CWindow::SetWindowPos


CWindow::CenterWindow

This method centers the window against a given window.

Syntax

BOOL CenterWindow( HWND hWndCenter = NULL );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::MoveWindow , CWindow::SetWindowPos


CWindow::CheckDlgButton

This method changes the check state of the specified button.

Syntax

BOOL CheckDlgButton( int nIDButton, UINT nCheck );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::CheckRadioButton , CWindow::IsDlgButtonChecked


CWindow::CheckRadioButton

This method checks the specified radio button.

Syntax

BOOL CheckRadioButton( int nIDFirstButton, int nIDLastButton, int nIDCheckButton );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::CheckDlgButton


CWindow::ChildWindowFromPoint

This method retrieves the child window containing the specified point.

Syntax

HWND ChildWindowFromPoint( POINT point ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::ClientToScreen

This method converts client coordinates to screen coordinates. The second version of this method allows you to convert the coordinates of a Rect structure.

Syntax

BOOL ClientToScreen( LPPOINT lpPoint ) const;

BOOL ClientToScreen( LPRECT lpRect ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::ScreenToClient


CWindow::CreateCaret

This method creates a new shape for the system caret.

Syntax

BOOL CreateCaret( HBITMAP pBitmap );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE only supports solid carets, so you should always set the hBitmap argument to NULL.

See Also

CWindow Overview, CWindow Methods, CWindow::CreateSolidCaret , CWindow::CreateGrayCaret


CWindow::CreateGrayCaret

This method creates a gray rectangle for the system caret. It passes (HBITMAP) 1 as the bitmap handle parameter to the Win32 function.

Syntax

BOOL CreateGrayCaret( int nWidth, int nHeight );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::CreateCaret, CWindow::CreateSolidCaret


CWindow::CreateSolidCaret

This method creates a solid rectangle for the system caret. It passes (HBITMAP) 0 as the bitmap handle parameter to the Win32 function.

Syntax

BOOL CreateSolidCaret( int nWidth, int nHeight );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::CreateCaret, CWindow::CreateGrayCaret


CWindow::CWindow

This is the constructor. It initializes the m_hWnd member to hWnd, which by default is NULL

Syntax

CWindow( HWND hWnd = NULL );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::DestroyWindow

This method destroys the window associated with the CWindow object and sets m_hWnd to NULL. It does not destroy the CWindow object itself.

Syntax

BOOL DestroyWindow( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::Detach

This method detaches m_hWnd from the CWindow object and sets m_hWnd to NULL.

Syntax

BOOL Detach( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::Attach


CWindow::DrawMenuBar

This method redraws the menu bar.

Syntax

BOOL DrawMenuBar( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::EnableWindow

This method enables or disables input.

Syntax

BOOL EnableWindow( BOOL bEnable = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::IsWindowEnabled


CWindow::EndPaint

This method marks the end of painting.

Syntax

void EndPaint( LPPAINTSTRUCT lpPaint );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::BeginPaint


CWindow::GetClientRect

This method retrieves the coordinates of the client area.

Syntax

BOOL GetClientRect( LPRECT lpRect ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetWindowRect


CWindow::GetDC

This method retrieves a device context for the client area.

Syntax

HDC GetDC( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetWindowDC , CWindow::ReleaseDC


CWindow::GetDlgCtrlID

This method retrieves the window's identifier (for child windows only).

Syntax

int GetDlgCtrlID( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetDlgCtrlID


CWindow::GetDlgItem

This method retrieves the specified child window.

Syntax

HWND GetDlgItem( int nID ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

The GetDlgItem method only works for immediate child controls of a dialog box—it doesn't search through nested dialog boxes.

See Also

CWindow Overview, CWindow Methods


CWindow::GetDlgItemInt

This method translates a control's text to an integer.

Syntax

UINT GetDlgItemInt( int nID, BOOL* lpTrans = NULL, BOOL bSigned = TRUE ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

The GetDlgItemInt method can only translate text strings of up to 48 characters.

See Also

CWindow Overview, CWindow Methods, CWindow::SetDlgItemInt , CWindow::GetDlgItemText


CWindow::GetDlgItemText

This method retrieves a control's text. The second version of this method allows you to copy the control's text to a BSTR. This version returns TRUE if the text is successfully copied; otherwise, FALSE.

Syntax

UINT GetDlgItemText( int nID, LPTSTR lpStr, int nMaxCount ) const;

BOOL GetDlgItemText( int nID, BSTR& bstrText ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetDlgItemText , CWindow::GetDlgItem


CWindow::GetExStyle

This method retrieves the extended window styles of the window.

Syntax

DWORD GetExStyle( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::ModifyStyleEx


CWindow::GetFont

This method retrieves the window's current font by sending a WM_GETFONT message to the window.

Syntax

HFONT GetFont( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetFont


CWindow::GetIcon

This method retrieves the handle to the window's large or small icon. GetIcon sends a WM_GETICON message to the window.

Syntax

HICON GetIcon( BOOL bBigIcon = TRUE ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetIcon


CWindow::GetNextDlgGroupItem

This method retrieves the previous or next control within a group of controls.

Syntax

HWND GetNextDlgGroupItem( HWND hWndCtl, BOOL bPrevious = FALSE ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetNextDlgTabItem


CWindow::GetNextDlgTabItem

This method retrieves the previous or next control having the WS_TABSTOP style.

Syntax

HWND GetNextDlgTabItem( HWND hWndCtl, BOOL bPrevious = FALSE ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetNextDlgGroupItem


CWindow::GetParent

This method retrieves the immediate parent window.

Syntax

HWND GetParent( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetParent


CWindow::GetScrollPos

This method retrieves the position of the scroll box.

Syntax

int GetScrollPos( int nBar ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetScrollPos


CWindow::GetScrollRange

This method retrieves the scroll bar range.

Syntax

BOOL GetScrollRange( int nBar, LPINT lpMinPos, LPINT lpMaxPos ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetScrollRange


CWindow::GetStyle

This method retrieves the window styles of the window.

Syntax

DWORD GetStyle( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::GetTopLevelParent

This method retrieves the window's top-level parent window.

Syntax

HWND GetTopLevelParent( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetTopLevelWindow , CWindow::GetWindow


CWindow::GetTopLevelWindow

This method retrieves the window's top-level parent or owner window.

Syntax

HWND GetTopLevelWindow( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetTopLevelParent , CWindow::GetWindow


CWindow::GetUpdateRect

This method retrieves the coordinates of the smallest rectangle that completely encloses the update region.

Syntax

BOOL GetUpdateRect( LPRECT lpRect, BOOL bErase = FALSE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetUpdateRgn


CWindow::GetUpdateRgn

This method retrieves the update region and copies it into a specified region.

Syntax

int GetUpdateRgn( HRGN hRgn, BOOL bErase = FALSE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetUpdateRect


CWindow::GetWindow

This method retrieves the specified window.

Syntax

HWND GetWindow( UINT nCmd ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetTopLevelParent , CWindow::GetTopLevelWindow


CWindow::GetWindowDC

This method retrieves a device context for the entire window.

Syntax

HDC GetWindowDC( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetDC , CWindow::ReleaseDC


CWindow::GetWindowLong

This method retrieves a 32-bit value at a specified offset into the extra window memory.

Syntax

LONG GetWindowLong( int nIndex ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetWindowLong


CWindow::GetWindowRect

This method retrieves the window's bounding dimensions.

Syntax

BOOL GetWindowRect( LPRECT lpRect ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetClientRect


CWindow::GetWindowText

This method retrieves the window's text. The second version of this method allows you to store the text in a BSTR. If the text is successfully copied, the return value is TRUE; otherwise, the return value is FALSE.

Syntax

int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;

BOOL GetWindowText( BSTR& bstrText );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetWindowTextLength , CWindow::SetWindowText


CWindow::GetWindowTextLength

This method retrieves the length of the window's text.

Syntax

int GetWindowTextLength( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetWindowText


CWindow::HideCaret

This method hides the system caret.

Syntax

BOOL HideCaret( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::ShowCaret


CWindow::Invalidate

This method invalidates the entire client area and passes NULL for the RECT parameter to the InvalidateRect Win32 function.

Syntax

BOOL Invalidate( BOOL bErase = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::InvalidateRect , CWindow::ValidateRect


CWindow::InvalidateRect

This method invalidates the client area within the specified rectangle.

Syntax

BOOL InvalidateRect( LPCRECT lpRect, BOOL bErase = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::ValidateRect


CWindow::IsChild

This method determines whether the specified window is a child window.

Syntax

BOOL IsChild( const HWND hWnd ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::IsDlgButtonChecked

This method determines the check state of the button.

Syntax

UINT IsDlgButtonChecked( int nIDButton ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::CheckDlgButton


CWindow::IsWindowEnabled

This method determines whether the window is enabled for input.

Syntax

BOOL IsWindowEnabled( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::EnableWindow


CWindow::IsWindowVisible

This method determines the window's visibility state.

Syntax

BOOL IsWindowVisible( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::KillTimer

This method destroys a timer event.

Syntax

BOOL KillTimer( UINT nIDEvent );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::MapWindowPoints

This method converts a set of points from the window's coordinate space to the coordinate space of another window. The second version of this method allows you to convert the coordinates of a RECT structure.

Syntax

int MapWindowPoints( HWND hWndTo, LPPOINT lpPoint, UINT nCount ) const;

int MapWindowPoints( HWND hWndTo, LPRECT lpRect ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::MessageBox

This method displays a message box.

Syntax

int MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

CWindow::MessageBox doesn't support the constants IDCLOSE or IDHELP as return values. It also doesn't support the following styles for the nType parameter:

MB_SYSTEMMODAL

MB_TASKMODAL

MB_HELP

MB_RIGHT

MB_RTLREADING

MB_DEFAULT_DESKTOP_ONLY

MB_SERVICE_NOTIFICATION

MB_USERICON

See Also

CWindow Overview, CWindow Methods


CWindow::ModifyStyle

This method modifies the window styles of the CWindow object. Styles to be added or removed can be combined by using the bitwise OR ( | ) operator. See the CreateWindow function in the Win32 SDK for information about the available window styles.

Syntax

BOOL ModifyStyle( DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetStyle


CWindow::ModifyStyleEx

This method modifies the extended window styles of the CWindow object. Styles to be added or removed can be combined by using the bitwise OR ( | ) operator. See the CreateWindowEx function in the Win32 SDK for information about the available extended styles.

Syntax

BOOL ModifyStyleEx( DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetExStyle


CWindow::MoveWindow

This method changes the window's size and position. The second version of this method uses a RECT structure to determine the window's new position, width, and height.

Syntax

BOOL MoveWindow( int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SetWindowPos


CWindow::OpenClipboard

This method opens the Clipboard.

Syntax

BOOL OpenClipboard( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::PostMessage

This method places a message in the message queue associated with the thread that created the window and returns without waiting for the thread to process the message.

Syntax

BOOL PostMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SendMessage , CWindow::SendNotifyMessage


CWindow::ReleaseDC

This method releases a device context.

Syntax

int ReleaseDC( HDC hDC );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetDC , CWindow::GetWindowDC


CWindow::ScreenToClient

This method converts screen coordinates to client coordinates. The second version of this method allows you to convert the coordinates of a RECT structure.

Syntax

BOOL ScreenToClient( LPPOINT lpPoint ) const;

BOOL ScreenToClient( LPRECT lpRect ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::ClientToScreen


CWindow::ScrollWindowEx

This method scrolls the specified client area with additional features.

Syntax

int ScrollWindowEx( int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE dosn't support the SW_SCROLLCHILDREN flag in the flags parameter to this method.

See Also

CWindow Overview, CWindow Methods


CWindow::SendDlgItemMessage

This method sends a message to a control.

Syntax

LRESULT SendDlgItemMessage( int nID, UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SendMessage


CWindow::SendMessage

This method sends a message to the window and does not return until the window procedure has processed the message.

Syntax

LRESULT SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::PostMessage , CWindow::SendNotifyMessage


CWindow::SendNotifyMessage

This method sends a message to the window. If the window was created by the calling thread, SendNotifyMessage does not return until the window procedure has processed the message. Otherwise, it returns immediately.

Syntax

BOOL SendNotifyMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::SendMessage , CWindow::PostMessage


CWindow::SetActiveWindow

This method activates the window.

Syntax

HWND SetActiveWindow( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::SetCapture

This method sends all subsequent mouse input to the window.

Syntax

HWND SetCapture( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::SetDlgCtrlID

This method sets the identifier of the window to the specified value.

Syntax

int SetDlgCtrlID( int nID );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetDlgCtrlID


CWindow::SetDlgItemInt

This method changes a control's text to the string representation of an integer value.

Syntax

BOOL SetDlgItemInt( int nID, UINT nValue, BOOL bSigned = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

The bSigned parameter is not used in Windows CE. All values passed in the nValue parameter are assumed to be signed.

See Also

CWindow Overview, CWindow Methods, CWindow::SetDlgItemText


CWindow::SetDlgItemText

This method changes a control's text.

Syntax

BOOL SetDlgItemText( int nID, LPCTSTR lpszString );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetDlgItemText, CWindow::SetDlgItemInt


CWindow::SetFocus

This method sets the input focus to the window.

Syntax

HWND SetFocus( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

In Windows CE, you can't set the keyboard focus to a window associated with another thread's message queue. There is one exception. If a window on one thread is the child of the window on the other thread, or if the windows are siblings of the same parent, the thread associated with one window can set the focus to the other window even though it belongs to a different thread.

See Also

CWindow Overview, CWindow Methods


CWindow::SetFont

This method changes the window's current font by sending a WM_SETFONT message to the window.

Syntax

void SetFont( HFONT hFont, BOOL bRedraw = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetFont


CWindow::SetIcon

This method sets the window's large or small icon to the icon identified by hIcon. SetIcon sends a WM_SETICON message to the window.

Syntax

HICON SetIcon( HICON hIcon, BOOL bBigIcon = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetIcon


CWindow::SetParent

This method changes the parent window.

Syntax

HWND SetParent( HWND hWndNewParent );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetParent


CWindow::SetRedraw

This method sets or clears the redraw flag by sending a WM_SETREDRAW message to the window. Call SetRedraw to allow changes to be redrawn or to prevent changes from being redrawn..

Syntax

void SetRedraw( BOOL bRedraw = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::SetScrollPos

This method changes the position of the scroll box.

Syntax

int SetScrollPos( int nBar, int nPos, BOOL bRedraw = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetScrollPos


CWindow::SetScrollRange

This method changes the scroll bar range.

Syntax

BOOL SetScrollRange( int nBar, int nMinPos, int nMaxPos, BOOL bRedraw = TRUE );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetScrollRange


CWindow::SetTimer

This method creates a timer event.

Syntax

UINT SetTimer( UINT nIDEvent, UINT nElapse, void ( CALLBACK EXPORT* lpfnTimer )( HWND, UINT, UINT, DWORD ) );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::KillTimer


CWindow::SetWindowLong

This method sets a 32-bit value at a specified offset into the extra window memory.

Syntax

LONG SetWindowLong( int nIndex, LONG dwNewLong );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetWindowLong


CWindow::SetWindowPos

This method sets the window size, position, and Z order. The second version of this method uses a RECT structure to set the window's new position, width, and height.

Syntax

BOOL SetWindowPos( HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags );

BOOL SetWindowPos( HWND hWndInsertAfter, LPCRECT lpRect, UINT nFlags );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::BringWindowToTop, CWindow::MoveWindow


CWindow::SetWindowText

This method changes the window's text.

Syntax

BOOL SetWindowText( LPCTSTR lpszString );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::GetWindowText


CWindow::ShowCaret

This method displays the system caret.

Syntax

BOOL ShowCaret( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::HideCaret


CWindow::ShowWindow

This method sets the window's show state.

Syntax

BOOL ShowWindow( int nCmdShow );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

In Windows CE, ShowWindow only supports the following values for the nCmdShow parameter:

SW_HIDE

SW_SHOWNA

SW_SHOWNORMAL

See Also

CWindow Overview, CWindow Methods


CWindow::UpdateWindow

This method updates the client area.

Syntax

BOOL UpdateWindow( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods


CWindow::ValidateRect

This method validates the client area within the specified rectangle.

Syntax

BOOL ValidateRect( LPCRECT lpRect );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Methods, CWindow::InvalidateRect


CWindow Operators

Operators
operator HWND | Converts a CWindow object to an HWND.
operator = | Assigns an HWND to the CWindow object by setting the m_hWnd member to hWnd.

See Also

CWindow Overview, CWindow Methods, CWindow Data Members


CWindow::operator HWND

This operator converts a CWindow object to an HWND.

Syntax

operator HWND( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Operators


CWindow::operator =

This operator assigns an HWND to the CWindow object by setting the m_hWnd member to hWnd.

Syntax

operator HWND( ) const;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindow Overview, CWindow Operators


CWindow Data Members

Data Members
m_hWnd The handle to the window associated with the CWindow object.

See Also

CWindow Overview, CWindow Methods, CWindow Operators


CWindow::m_hWnd

This data member contains a handle to the window associated with the CWindow object.

Syntax

HWND m_hWnd;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

See Also

CWindow Overview, CWindow Data Members, CWindow::CWindow


CWindowImpl

The CWindowImpl class allows you to create a new window or to make an existing windows into a subclass. CWindowImpl's window procedure uses a message map to direct messages to the appropriate handlers.

Syntax

T Your class, derived from CWindowImpl.

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE supports a couple of new extended window styles that are not supported by other Windows platforms. It also does not support some of the window styles the desktop platforms support. This means you can't use all the same flags for the dwStyle and dwExStyle parameters to the Create method that you can use on other Windows platforms. Windows CE also doesn't support stand alone menu bars.

See Also

CWindowImpl Methods, CWindowImpl Data Members, CContainedWindow , CWindow, CMessageMap


CWindowImpl Methods

Class Methods |
Create | Creates a window.
CWindowImplBase Methods |
DefWindowProc | Provides default message processing.
GetWndClassInfo | Returns a static instance of CWndClassInfo, which manages the window class information.
Subclass Window | Subclasses a window.
UnsubclassWindow | Restores a previously subclassed window.
WindowProc | Processes messages sent to the window.

See Also

CWindowImpl Overview, CWindowImpl Data Members


CWindowImpl::Create

This method creates a window based on a new window class. Create first registers the window class if it has not yet been registered. The newly created window is automatically attached to the CWindowImpl object.

Syntax

HWND Create( HWND hWndParent, RECT& rcPos, LPCTSTR szWindowName = NULL, DWORD dwStyle = WS_CHILD | WS_VISIBLE, DWORD dwExStyle = 0, UINT nID = 0 );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE doesn't support stand alone menu bars, so the nID parameter must be set to zero, unless you're using it as a child-window identifier.

Windows CE supports the following two new extended window styles.

WS_EX_NOACTIVATE | A top level window created with this style can't be activated. If a child window has this style, tapping it won't cause its top-level parent to be activated. A window that has this style will receive stylus events, but neither it nor its child windows can get the focus.
WS_EX_NOANIMATION | A window created with this style doesn't show animated exploding and imploding rectangles, and doesn't have a button on the taskbar.

Windows CE doesn't support the following dwExStyle flags.

WS_EX_ACCEPTFILES | WS_EX_LEFTSCROLLBAR
WS_EX_LEFT | WS_EX_MDICHILD
WS_EX_LTRREADING | WS_EX_PALETTEWINDOW
WS_EX_NOPARENTNOTIFY | WS_EX_RIGHTSCROLLBAR
WS_EX_RIGHT | WS_EX_TOOLWINDOW
WS_EX_RTLREADING | WS_EX_TOPMOST
WS_EX_APPWINDOW | WS_EX_TRANSPARENT

Windows CE doesn't support the following dwStyle flags.

WS_CHILDWINDOW | WS_ICONIC
WS_MAXIMIZE | WS_MAXIMIZEBOX
WS_MINIMIZE | WS_MINIMIZEBOX
WS_OVERLAPPEDWINDOW | WS_POPUPWINDOW
WS_SIZEBOX | WS_THICKFRAME
WS_TILED | WS_TILEDWINDOW

All windows in Windows CE implicitly have the WS_CLIPSIBLINGS and WS_CLIPCHILDREN styles.

See the global function CreateWindow for control styles that Windows CE doesn't support.

See Also

CWindowImpl Overview, CWindowImpl Methods, CWindowImpl::GetWndClassInfo , CWndClassInfo::Register, CWindow::m_hWnd


CWindowImpl::DefWindowProc

This method is called by WindowProc to process messages not handled by the message map. By default, DefWindowProc calls the CallWindowProc function to send the message information to the window procedure specified in m_pfnSuperWindowProc.

Syntax

LRESULT DefWindowProc( UINT uMsg, WPARAM wParam, LPARAM lParam );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindowImpl Overview, CWindowImpl Methods


CWindowImpl::GetWndClassInfo

This method called by Create to access the window class information. By default, CWindowImpl obtains this method through the DECLARE_WND_CLASS macro, which specifies a new window class.

Syntax

static CWndClassInfo& GetWndClassInfo( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindowImpl Overview, CWindowImpl Methods, CWindowImpl::GetWndClassInfo


CWindowImpl::SubclassWindow

This method subclasses the window identified by hWnd and attaches it to the CWindowImpl object.

Syntax

BOOL SubclassWindow( HWND hWnd );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindowImpl Overview, CWindowImpl Methods, CWindowImpl::UnsubclassWindow


CWindowImpl::UnsubclassWindow

This method detaches the subclassed window from the CWindowImpl object and restores the original window procedure, saved in m_pfnSuperWindowProc.

Syntax

HWND UnsubclassWindow( );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindowImpl Overview, CWindowImpl Methods, CWindowImpl::SubclassWindow


CWindowImpl::WindowProc

This method implements the window procedure. WindowProc uses the default message map to direct messages to the appropriate handlers.

Syntax

static LRESULT CALLBACK WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindowImpl Overview, CWindowImpl Methods


CWindowImpl Data Members

Data Members |
m_pfnSuperWindowProc | Points to the window class's original window procedure.

See Also

CWindowImpl Overview, CWindowImpl Methods


CWindowImpl::m_pfnSuperWindowProc

This data member points to the window class's original window procedure

Syntax

WNDPROC m_pfnSuperWindowProc;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWindowImpl Overview, CWindowImpl Data Members, CWindowImpl::DefWindowProc , CWindowImpl::Create, CWindowImpl::SubclassWindow,


CWndClassInfo

The CWndClassInfo class manages the information of a window class. You typically use CWndClassInfo through one of two macros, DECLARE_WND_CLASS or DECLARE_WND_SUPERCLASS.

Syntax

class CWndClassInfo

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

In ATL for Windows CE, the m_wc member of the CWndClassInfo class is a WNDCLASS structure, rather than a WNDCLASSEXstructure.

See Also

CWndClassInfo Methods, CWndClassInfo Data Members, CComControl, CWndClassInfo::m_wc, DECLARE_WND_CLASS , DECLARE_WND_SUPERCLASS


CWndClassInfo Methods

CWndClassInfo Methods |
Register | Registers the window class.

See Also

CWndClassInfo Overview, CWndClassInfo Data Members


CWndClassInfo::Register

This method is called by CWindowImpl::Create to register the window class if it has not been registered.

Syntax

ATOM Register( WNDPROC* pProc );

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWndClassInfo Overview, CWndClassInfo Methods, CWndowImpl::Create , CWndClassInfo::m_atom, CWndClassInfo::m_wc, CWndClassInfo::pWndProc


CWndClassInfo Data Members

CWndClassInfo Data Members |
m_atom | Uniquely identifies the registered window class.
m_bSystemCursor | Specifies whether the cursor resource refers to a system cursor or to a cursor contained in a module resource.
m_lpszCursorID | Specifies the name of the cursor resource.
m_lpszOrigName | Contains the name of an existing window class.
m_szAutoName | Holds an ATL-generated name of the window class.
m_wc | Maintains window class information in a WNDCLASS structure.
PWndProc | Points to the window procedure of an existing window class.

See Also

CWndClassInfo Overview, CWndClassInfo Methods


CWndClassInfo::m_atom

This data member contains the unique identifier for the registered window class.

Syntax

ATOM m_atom;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWndClassInfo Overview, CWndClassInfo Data Members, CWndClassInfo::Register


CWndClassInfo::m_bSystemCursor

If m_bSystemCursor has a value of TRUE, the system cursor resource will be loaded when the window class is registered. Otherwise, the cursor resource contained in your module will be loaded.

Syntax

BOOL m_bSystemCursor;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWndClassInfo Overview, CWndClassInfo Data Members, CWndClassInfo::m_lpszCursorID


CWndClassInfo::m_lpszCursorID

This data member specifies either the name of the cursor resource or the resource identifier in the low-order word and zero in the high-order word. When the window class is registered, the handle to the cursor identified by m_lpszCursorID is retrieved and stored in m_wc.

Syntax

LPCTSTR m_lpszCursorID;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWndClassInfo Overview, CWndClassInfo Data Members, CWndClassInfo::m_bSystemCursor , CWndClassInfo::m_wc


CWndClassInfo::m_lpszOrigName

This data member contains the name of an existing window class. CWndClassInfo uses m_lpszOrigName only when you include the DECLARE_WND_SUPERCLASS macro in your class definition.

Syntax

LPCTSTR m_lpszOrigName;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWndClassInfo Overview, CWndClassInfo Data Members, CWndClassInfo::m_wc , CWndClassInfo::pWndProc, DECLARE_WND_SUPERCLASS


CWndClassInfo::m_szAutoName

This data member holds the name of the window class. CWndClassInfo uses m_szAutoName only if NULL is passed for the WndClassName parameter to DECLARE_WND_CLASS or DECLARE_WND_SUPERCLASS.

Syntax

TCHAR m_szAutoName[13];

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWndClassInfo Overview, CWndClassInfo Data Members, CWindowImpl::Create , CWndClassInfo::m_atom, CWndClassInfo::m_wc, DECLARE_WND_CLASS, DECLARE_WND_SUPERCLASS


CWndClassInfo::m_wc

This data member maintains the window class information in a WNDCLASS structure.

Syntax

WNDCLASS m_wc;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

The m_wc data member is a WNDCLASS structure. On desktop Windows platforms, this data member is a WNDCLASSEX structure.

See Also

CWndClassInfo Overview, CWndClassInfo Data Members, WNDCLASS


CWndClassInfo::pWndProc

This data member points to the window procedure of an existing window class. CWndClassInfo uses pWndProc only when you include the DECLARE_WND_SUPERCLASS macro in your class definition.

Syntax

WNDPROC pWndProc;

At a Glance

Header file: Atlwin.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

CWndClassInfo Overview, CWndClassInfo Data Members, CWndClassInfo::m_wc , CWndClassInfo::m_lpszOrigName, DECLARE_WND_SUPERCLASS


IConnectionPointContainerImpl

The IConnectionPointContainerImpl class implements a connection point container to manage a collection of IConnectionPointImpl objects.

Syntax

template< class T >
class IConnectionPointContainerImpl

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointContainerImpl Methods, IConnectionPointContainer


IConnectionPointContainerImpl Methods

IConnectionPointContainer Methods |
EnumConnectionPoints | Creates an enumerator to iterate through the connection points supported in the connectable object.
FindConnectionPoint | Creates an enumerator to iterate through the connection points supported in the connectable object.

See Also

IConnectionPointContainerImpl Overview


IConnectionPointContainerImpl::EnumConnectionPoints

This method creates an enumerator to iterate through the connection points supported in the connectable object.

Syntax

HRESULT EnumConnectionPoints( IEnumConnectionPoints **ppEnum );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointContainerImpl Overview, IConnectionPointContainerImpl Methods, IConnectionPointContainer::EnumConnectionPoints , IConnectionPointImpl


IConnectionPointContainerImpl::FindConnectionPoint

This method retrieves an interface pointer to the connection point that supports the specified IID.

Syntax

HRESULT FindConnectionPoint( REFIID riid, IConnectionPoint** ppCP );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointContainerImpl Overview, IConnectionPointContainerImpl Methods, IConnectionPointContainer::FindConnectionPoint , IConnectionPointImpl


IConnectionPointImpl

This class implements a connection point, which allows an object to expose an outgoing interface to the client. The client implements this interface on an object called a sink.

ATL uses IConnectionPointContainerImpl to implement the connectable object. Each connection point within the connectable object represents an outgoing interface, identified by piid. Class CDV manages the connections between the connection point and a sink. Each connection is uniquely identified by a "cookie."

Syntax

template< class T, const IID* piid, class CDV = CComDynamicUnkArray >
class IConnectionPointImpl : public _ICPLocator< piid >

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointImpl Methods, IConnectionPointImpl Data Members, IConnectionPoint , IConnectionPointContainerImpl


IConnectionPointImpl Methods

IconnectionPoint Methods |
Advise | Establishes a connection between the connection point and a sink.
EnumConnections | Creates an enumerator to iterate through the connections for the connection point.
GetConnectionInterface | Retrieves the IID of the interface represented by the connection point.
GetConnectionPointContainer | Retrieves an interface pointer to the connectable object.
Unadvise | Terminates a connection previously established through Advise.

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Data Members


IConnectionPointImpl::Advise

This method establishes a connection between the connection point and a sink.

Syntax

HRESULT Advise( IUnknown* pUnkSink, DWORD* pdwCookie );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Methods, IConnectionPoint::Advise , IConnectionPointImpl::UnAdvise


IConnectionPointImpl::EnumConnections

This method creates an enumerator to iterate through the connections for the connection point.

Syntax

HRESULT EnumConnections( IEnumConnections** ppEnum );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Methods, IConnectionPoint::EnumConnections , IEnumConnections


IConnectionPointImpl::GetConnectionInterface

This method retrieves the IID of the interface represented by the connection point.

Syntax

HRESULT GetConnectionInterface( IID* piid2 );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Methods, IConnectionPoint::GetConnectonInterface


IConnectionPointImpl::GetConnectionPointContainer

This method establishes a connection between the connection point and a sink.

Syntax

HRESULT GetConnectionPointContainer( IConnectionPointContainer** ppCPC );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Methods, IConnectionPoint::GetConnectionPointContainer , IConnectionPointContainerImpl


IConnectionPointImpl::Unadvise

This method terminates a connection previously established through Advise.

Syntax

HRESULT Unadvise( DWORD dwCookie );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Methods, IConnectionPoint::Unadvise , IConnectionPointImpl::Advise


IConnectionPointImpl Data Members

IconnectionPoint Data Members |
m_vec | Manages the connections for the connection point.

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Methods


IConnectionPointImpl::m_vec

This data member manages the connections between the connection point object and a sink. By default, m_vec is of type CComDynamicUnkArray.

Syntax

CDV m_vec;

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IConnectionPointImpl Overview, IConnectionPointImpl Data Members, CComDynamicUnkArray


IDataObjectImpl

The IDataObjectImpl class implements the IDataObject interface which provides methods to support Uniform Data Transfer and manages connections to advise sinks to handle data change notifications.

Syntax

template< class T >
class IDataObjectImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

Windows CE doesn't support the DAdvise, DUnadvise, or EnumDAdvise methodsof the IDataObjectImpl class, or the IDataObjectImpl::m_spDataAdviseHolder data member.

See Also

IDataObjectImpl Methods, IDataObject , IAdviseSink


IDataObjectImpl Methods

Class Methods |
FireDataChange | Sends a change notification back to each advise sink.
IDataObject Methods |
EnumFormatEtc | Creates an enumerator to iterate through the FORMATETC structures supported by the data object. The ATL implementation returns E_NOTIMPL.
GetCanonicalFormatEtc | Retrieves a logically equivalent FORMATETC structure to one that is more complex. The ATL implementation returns E_NOTIMPL.
GetData | Transfers data from the data object to the client. The data is described in a FORMATETC structure and is transferred through a STGMEDIUM structure.
GetDataHere | Similar to GetData, except the client must allocate the STGMEDIUM structure. The ATL implementation returns E_NOTIMPL.
QueryGetData | Determines whether the data object supports a particular FORMATETC structure for transferring data. The ATL implementation returns E_NOTIMPL.
SetData | Transfers data from the client to the data object. The ATL implementation returns E_NOTIMPL.

See Also

IDataObjectImpl Overview


IDataObjectImpl::EnumFormatEtc

This method creates an enumerator to iterate through the FORMATETC structures supported by the data object. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDataObjectImpl Overview, IDataObjectImpl Methods, IDataObject::EnumFormatEtc


IDataObjectImpl::FireDataChange

This method sends a change notification back to each advise sink that is currently being managed.

Syntax

HRESULT FireDataChange( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDataObjectImpl Overview, IDataObjectImpl Methods


IDataObjectImpl::GetCanonicalFormatEtc

This method retrieves a logically equivalent FORMATETC structure to one that is more complex. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetCanonicalFormatEtc( FORMATETC* pformatetcIn, FORMATETC* pformatetcOut );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDataObjectImpl Overview, IDataObjectImpl Methods, IDataObject::GetCanonicalFormatEtc , FORMATETC


IDataObjectImpl::GetData

This method transfers data from the data object to the client. The Transfers data from the data object to the client. The pformatetcIn parameter must specify a storage medium type of TYMED_MFPICT.

Syntax

HRESULT GetData( FORMATETC* pformatetcIn, STGMEDIUM* pmedium );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDataObjectImpl Overview, IDataObjectImpl Methods, IDataObject::GetData , IDataObjectImpl::GetDataHere, IDataObjectImpl::QueryGetData, IDataObjectImpl::SetData


IDataObjectImpl::GetDataHere

This method is similar to GetData, except the client must allocate the STGMEDIUM structure. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetDataHere( FORMATETC* pformatetc, STGMEDIUM* pmedium );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDataObjectImpl Overview, IDataObjectImpl Methods, IDataObject::GetDataHere , IDataObjectImpl::GetData, IDataObjectImpl::QueryGetData, IDataObjectImpl::SetData


IDataObjectImpl::QueryGetData

This method determines whether the data object supports a particular FORMATETC structure for transferring data. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT QueryGetData( FORMATETC* pformatetc );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDataObjectImpl Overview, IDataObjectImpl Methods, IDataObject::QueryGetData , IDataObjectImpl::GetData, IDataObjectImpl::GetDataHere, IDataObjectImpl::SetData


IDataObjectImpl::SetData

This method transfers data from the client to the data object. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT SetData( FORMATETC* pformatetc, STGMEDIUM* pmedium, BOOL fRelease );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation)

See Also

IDataObjectImpl Overview, IDataObjectImpl Methods, IDataObject::SetData , IDataObjectImpl::GetData, IDataObjectImpl::GetDataHere, IDataObjectImpl::QueryGetData


IDispatchImpl

IDispatchImpl provides a default implementation for the IDispatch portion of any dual interface on your object. A dual interface derives from IDispatch and uses only Automation-compatible types. Like a dispinterface, a dual interface supports early and late binding; however, a dual interface differs in that it also supports vtable binding.

Syntax

template< class T, const IID* piid, const GUID* plibid, WORD wMajor = 1, WORD wMinor = 0, class tihclass = CComTypeInfoHolder >
class IDispatchImpl : public T

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDispatchImpl Methods, IDispatchImpl Data Members, IDispatch , ITypeInfo


IDispatchImpl Methods

Class Methods |
IDispatchImpl | Constructor.
IDispatch Methods |
GetIDsOfNames | Maps a set of names to a corresponding set of dispatch identifiers.
GetTypeInfo | Retrieves the type information for the dual interface.
GetTypeInfoCount | Determines whether there is type information available for the dual interface.
Invoke | Provides access to the methods and properties exposed by the dual interface.

See Also

IDispatchImpl Overview, IDispatchImpl Data Members


IDispatchImpl::GetIDsOfNames

This method maps a set of names to a corresponding set of dispatch identifiers.

Syntax

HRESULT GetIDsOfNames( REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDispatchImpl Overview, IDispatchImpl Methods, IDispatch::GetIDsOfNames


IDispatchImpl::GetTypeInfo

This method retrieves the type information for the dual interface.

Syntax

HRESULT GetTypeInfo( UINT itinfo, LCID lcid, ITypeInfo** pptinfo );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDispatchImpl Overview, IDispatchImpl Methods, IDispatch::GetTypeInfo , IDispatchImpl::GetTypeInfoCount


IDispatchImpl::GetTypeInfoCount

This method determines whether there is type information available for the dual interface.

Syntax

HRESULT GetTypeInfoCount( UINT* pctinfo );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDispatchImpl Overview, IDispatchImpl Methods, IDispatch::GetTypeInfoCount , IDispatchImpl::GetTypeInfo


IDispatchImpl::IDispatchImpl

This method, the constructor, calls AddRef on the _tih data member. The destructor calls Release.

Syntax

IDispatchImpl( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDispatchImpl Overview, IDispatchImpl Methods


IDispatchImpl::Invoke

This method provides access to the methods and properties exposed by the dual interface.

Syntax

HRESULT Invoke( DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

See Also

IDispatchImpl Overview, IDispatchImpl Methods, IDispatch::Invoke


IDispatchImpl Data Members

Data Members |
_tih | Manages the type information for the dual interface.

See Also

IDispatchImpl Overview, IDispatchImpl Methods


IDispatchImpl::_tih

This static data member is an instance of the class template parameter, tihclass, which by default is CComTypeInfoHolder. _tih manages the type information for the dual interface.

Syntax

static tihclass _tih;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IDispatchImpl Overview, IDispatchImpl Data Members


IObjectSafetyImpl

The IObjectSafetyImpl class implements the IObjectSafety interface which allows a client to retrieve and set an object's safety levels. For example, a web browser may call IObjectSafety::SetInterfaceSafetyOptions to make a control safe for initialization or safe for scripting.

Syntax

template< class T >
class IObjectSafetyImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IObjectSafetyImpl Methods, IObjectSafetyImpl Data Members, IObjectSafety


IObjectSafetyImpl Methods

IObjectSafety Methods |
GetInterfaceSafetyOptions | Retrieves the safety options supported by the object, as well as the safety options currently set for the object.
SetInterfaceSafetyOptions | Makes the object safe for initialization or scripting.

See Also

IObjectSafetyImpl Overview, IObjectSafetyImpl Data Members


IObjectSafetyImpl::GetInterfaceSafetyOptions

This method retrieves the safety options supported by the object, as well as the safety options currently set for the object.

Syntax

HRESULT GetInterfaceSafetyOptions( REFIID riid, DWORD* pdwSupportedOptions, DWORD* pdwEnabledOptions );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IObjectSafetyImpl Overview, IObjectSafetyImpl Methods, IObjectSafety::GetInterfaceSafetyOptions , IObjectSafetyImpl::SetInterfaceSafetyOptions


IObjectSafetyImpl::SetInterfaceSafetyOptions

This method makes the object safe for initialization or scripting.

Syntax

HRESULT SetInterfaceSafetyOptions( REFIID riid, DWORD dwOptionsSetMask, DWORD dwEnabledOptions );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IObjectSafetyImpl Overview, IObjectSafetyImpl Methods, IObjectSafety::SetInterfaceSafetyOptions , IObjectSafetyImpl::GetInterfaceSafetyOptions


IObjectSafetyImpl Data Members

IObjectSafety Data Memberss |
m_dwSafety | Stores the object's current safety level.

See Also

IObjectSafetyImpl Overview, IObjectSafetyImpl Methods


IObjectSafetyImpl::m_dwSafety

This data member stores the object's current safety level.

Syntax

DWORD m_dwSafety;

At a Glance

Header file: | Atlctl.h
Platforms: |
Versions: | Version 2.0 and later
Complete documentation: | Visual C++ documentation

See Also

IObjectSafetyImpl Overview, IObjectSafetyImpl Data Members, IObjectSafetyImpl::GetInterfaceSafetyOptions , IObjectSafetyImpl::SetInterfaceSafetyOptions


IObjectWithSiteImpl

The IObjectWithSiteImpl class implements the IObjectWithSite interface which allows an object to communicate with its site.

Syntax

template< class T >
class IObjectWithSiteImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IObjectWithSiteImpl Methods, IObjectWithSiteImpl Data Members, IObjectWithSite


IObjectWithSiteImpl Methods

IObjectWithSite Methods |
GetSite | Queries the site for an interface pointer.
SetSite | Provides the object with the site's Iunknown pointer.

See Also

IObjectWithSiteImpl Overview, IObjectWithSiteImpl Data Members


IObjectWithSiteImpl::GetSite

This method queries the site for a pointer to the interface identified by riid. If the site supports this interface, the pointer is returned via ppvSite. Otherwise, ppvSite is set to NULL.

Syntax

HRESULT GetSite( REFIID riid, void **ppvSite );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IObjectWithSiteImpl Overview, IObjectWithSiteImpl Methods, IObjectWithSite::GetSite , IObjectWithSiteImpl::SetSite


IObjectWithSiteImpl::SetSite

This method provides the object with the site's IUnknown pointer.

Syntax

HRESULT SetSite( IUnknown* pUnkSite );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IObjectWithSiteImpl Overview, IObjectWithSiteImpl Methods, IObjectWithSite::SetSite , IObjectWithSiteImpl::GetSite


IObjectWithSiteImpl Data Members

IObjectWithSite Data Members |
m_spUnkSite | Manages the site's IUnknown pointer.

See Also

IObjectWithSiteImpl Overview, IObjectWithSiteImpl Methods


IObjectWithSiteImpl::m_spUnkSite

This data member manages the site's IUnknown pointer. m_spUnkSite initially receives this pointer through a call to SetSite.

Syntax

CComPtr< IUnknown > m_spUnkSite;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IObjectWithSiteImpl Overview, IObjectWithSiteImpl Data Members, IObjectWithSiteImpl::GetSite , IObjectWithSiteImpl::SetSite


IOleControlImpl

The IOleControlImpl class implements the IOleControl interface which provides the features for supporting keyboard mnemonics, ambient properties, and events in control objects.

Syntax

template< class T >
class IOleControlImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleControlImpl Methods, IOleControl , IOleObjectImpl


IOleControlImpl Methods

IOleControl Methods |
FreezeEvents | Indicates whether or not the container ignores or accepts events from the control.
GetControlInfo | Fills in information about the control's keyboard behavior. The ATL implementation returns E_NOTIMPL.
OnAmbientPropertyChange | Informs a control that one or more of the container's ambient properties has changed. The ATL implementation returns S_OK.
OnMnemonic | Informs the control that a user has pressed a specified keystroke. The ATL implementation returns E_NOTIMPL.

See Also

IOleControlImpl Overview


IOleControlImpl::FreezeEvents

This method increments the control class's m_nFreezeEvents data member if bFreeze is TRUE, and decrements m_nFreezeEvents if bFreeze is FALSE. FreezeEvents then returns S_OK.

Syntax

HRESULT FreezeEvents( BOOL bFreeze );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation)

See Also

IOleControlImpl Overview, IOleControlImpl Methods, IOleControl::FreezeEvents , CComControl::m_nFreezeEvents


IOleControlImpl::GetControlInfo

This method fills in information about the control's keyboard behavior. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetControlInfo( LPCONTROLINFO pCI );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation)

See Also

IOleControlImpl Overview, IOleControlImpl Methods, IOleControl::GetControlInfo


IOleControlImpl::OnAmbientPropertyChange

This method informs a control that one or more of the container's ambient properties has changed. The ATL implementation returns S_OK.

Syntax

HRESULT OnAmbientPropertyChange( DISPID dispid );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation)

See Also

IOleControlImpl Overview, IOleControlImpl Methods, IOleControl::OnAmbientPropertyChange


IOleControlImpl::OnMnemonic

This method informs the control that a user has pressed a specified keystroke. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT OnMnemonic( LPMSG pMsg );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation)

See Also

IOleControlImpl Overview, IOleControlImpl Methods, IOleControl::OnMnemonic


IOleInPlaceActiveObjectImpl

The IOleInPlaceActiveObjectImpl class implements the IOleInPlaceActiveObject interface which assists communication between an in-place control and its container; for example, communicating the active state of the control and container, and informing the control it needs to resize itself.

Syntax

template< class T >
class IOleInPlaceActiveObjectImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Methods, IOleInPlaceActiveObject


IOleInPlaceActiveObjectImpl Methods

IOleWindow Methods |
ContextSensitiveHelp | Enables context-sensitive help. The ATL implementation returns E_NOTIMPL.
GetWindow | Gets a window handle.
IOleInPlaceActiveObject Methods |
EnableModeless | Enables modeless dialog boxes. The ATL implementation returns S_OK.
OnDocWindowActivate | Notifies the control when the container's document window is activated or deactivated.
OnFrameWindowActivate | Notifies the control when the container's top-level frame window is activated or deactivated.
ResizeBorder | Informs the control it needs to resize its borders. The ATL implementation returns S_OK.
TranslateAccelerator | Processes menu accelerator-key messages from the container. The ATL implementation returns E_NOTIMPL.

See Also

IOleInPlaceActiveObjectImpl Overview


IOleInPlaceActiveObjectImpl::ContextSensitiveHelp

This method enables context-sensitive help. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT ContextSensitiveHelp( BOOL fEnterMode );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Overview, IOleInPlaceActiveObjectImpl Methods, IOleWindow::ContextSensitiveHelp


IOleInPlaceActiveObjectImpl::EnableModeless

This method enables modeless dialog boxes. The ATL implementation returns S_OK.

Syntax

HRESULT EnableModeless( BOOL fEnable );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Overview, IOleInPlaceActiveObjectImpl Methods, IOleInPlaceActiveObject::EnableModeless


IOleInPlaceActiveObjectImpl::GetWindow

The container calls this method to get the window handle of the control. Some containers will not work with a control that has been windowless, even if it is currently windowed.

Syntax

HRESULT GetWindow( HWND* phwnd );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Overview, IOleInPlaceActiveObjectImpl Methods, IOleWindow::GetWindow


IOleInPlaceActiveObjectImpl::OnDocWindowActivate

This method notifies the control when the container's document window is activated or deactivated. The ATL implementation returns S_OK.

Syntax

HRESULT OnDocWindowActivate( BOOL fActivate );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Overview, IOleInPlaceActiveObjectImpl Methods, IOleInPlaceActiveObject::OnDocWindowActivate


IOleInPlaceActiveObjectImpl::OnFrameWindowActivate

This method notifies the control when the container's top-level frame window is activated or deactivated.

Syntax

HRESULT OnFrameWindowActivate( BOOL fActivate );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Overview, IOleInPlaceActiveObjectImpl Methods, IOleinPlaceActiveObject::OnFrameWindowActivate


IOleInPlaceActiveObjectImpl::ResizeBorder

This method informs the control it needs to resize its borders. The ATL implementation returns S_OK.

Syntax

HRESULT ResizeBorder( LPRECT prcBorder, IOleInPlaceUIWindow* pUIWindow, BOOL fFrameWindow );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Overview, IOleInPlaceActiveObjectImpl Methods, IOleInPlaceActiveObject::ResizeBorder


IOleInPlaceActiveObjectImpl::TranslateAccelerator

Processes menu accelerator-key messages from the container. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT TranslateAccelerator( LPMSG lpmsg );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceActiveObjectImpl Overview, IOleInPlaceActiveObjectImpl Methods, IOleinPlaceActiveObject::TranslateAccelerator


IOleInPlaceObjectWindowlessImpl

The IOleInPlaceObjectWindowlessImpl class implements the IOleInPlaceObjectWindowless interface which enables a windows control to receive window messages and to participate in drag-and-drop operations, and the IOleInPlaceObject interface which manages the reactivation and deactivation of in-place controls and determines how much of the control should be visible.

Syntax

template< class T >
class IOleInPlaceObjectWindowlessImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Methods, CComControl


IOleInPlaceObjectWindowlessImpl Methods

IOleWindow Methods |
ContextSensitiveHelp | Enables context-sensitive help. The ATL implementation returns E_NOTIMPL.
GetDropTarget | Supplies an active, windowless object that supports drag and drop. The ATL implementation returns E_NOTIMPL.
GetWindow | Gets a window handle.
IOleInPlaceObjectMethods |
InPlaceDeactivate | Deactivates an active in-place control.
ReactivateAndUndo | Reactivates a previously deactivated control. The ATL implementation returns E_NOTIMPL
SetObjectRects | Indicates what part of the in-place control is visible.
UIDeactivate | Deactivates and removes the user interface that supports in-place activation.
IOleInPlaceObjectWindowless Methods |
GetDropTarget | Supplies the IdropTarget interface for an in-place active, windowless object that supports drag and drop. The ATL implementation returns E_NOTIMPL.
OnWindowMessage | Dispatches a message from the container to a windowless control that is in-place active.

See Also

IOleInPlaceObjectWindowlessImpl Overview


IOleInPlaceObjectWindowlessImpl::ContextSensitiveHelp

This method enables context-sensitive help. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT ContextSensitiveHelp( BOOL fEnterMode );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, IOleWindow::ContextSensitiveHelp


IOleInPlaceObjectWindowlessImpl::GetDropTarget

This method supplies an active, windowless object that supports drag and drop. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetDropTarget( IDropTarget** ppDropTarget );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, IOleinPlaceObjectWindowless::GetDropTarget


IOleInPlaceObjectWindowlessImpl::GetWindow

The container calls this method to get the window handle of the control. Some containers will not work with a control that has been windowless, even if it is currently windowed.

Syntax

HRESULT GetWindow( HWND* phwnd );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, IOleWindow::GetWindow


IOleInPlaceObjectWindowlessImpl::InPlaceDeactivate

The container calls this method to deactivate an in-place active control. This method performs a full or partial deactivation depending on the state of the control.

Syntax

HRESULT InPlaceDeactivate( HWND* phwnd );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, CComControl::InPlaceActivate , IOleInPlaceObject::InPlaceDeactivate


IOleInPlaceObjectWindowlessImpl::OnWindowMessage

This method dispatches a message from a container to a windowless control that is in-place active.

Syntax

HRESULT OnWindowMessage( UINT msg, WPARAM WParam, LPARAM LParam, LRESULT plResultParam );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, IOleInPlaceObjectWindowless::OnWindowMessage


IOleInPlaceObjectWindowlessImpl::ReactivateAndUndo

This method reactivates a previously deactivated control. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT ReactivateAndUndo( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, IOleinPlaceObject::ReactivateAndUndo


IOleInPlaceObjectWindowlessImpl::SetObjectRects

The container calls this method to inform the control that its size and/or position has changed.

Syntax

HRESULT SetObjectRects( LPCRECT prcPos, LPCRECT prcClip );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, IOleinPlaceObject::SetObjectRects


IOleInPlaceObjectWindowlessImpl::UIDeactivate

This method deactivates and removes the control's user interface that supports in-place activation. Sets the control class's data member m_bUIActive to FALSE. The ATL implementation of this function always returns S_OK.

Syntax

HRESULT UIDeactivate( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleInPlaceObjectWindowlessImpl Overview, IOleInPlaceObjectWindowlessImpl Methods, IOleInPlaceObject::UIDeactivate


IOleObjectImpl

The IOleObjectImpl class implements the IOleObject interface through which a container communicates with a control.

Syntax

template< class T >
class IOleObjectImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

ATL for Windows CE doesn't support the EnumVerbs, GetMiscStatus, or GetUserType methods of the IOleObjectImpl class.

See Also

IOleObjectImpl Methods, IOleObject , CComControl


IOleObjectImpl Methods

IOleObject Methods |
Advise | Establishes an advisory connection with the control.
Close | Changes the control state from running to loaded.
DoVerb | Tells the control to perform one of its enumerated actions.
EnumAdvise | Enumerates the control's advisory connections.
GetClientSite | Retrieves the control's client site.
GetClipboardData | Retrieves the control's client site.
GetExtent | Retrieves the status of the control.
GetMoniker | Retrieves the control's moniker. The ATL implementation returns E_NOTIMPL.
GetUserClassID | Retrieves the control's class identifier.
InitFromData | Initializes the control from selected data. The ATL implementation returns E_NOTIMPL.
IsUpToDate | Checks if the control is up to date. The ATL implementation returns S_OK.
SetClientSite | Tells the control about its client site in the container.
SetColorScheme | Recommends a color scheme to the control's application, if any. The ATL implementation returns E_NOTIMPL.
SetExtent | Sets the extent of the control's display area.
SetHostNames | Tells the control the names of the container application and container document.
SetMoniker | Tells the control what its moniker is. The ATL implementation returns E_NOTIMPL.
Unadvise | Destroys an advisory connection with the control.
Update | Updates the control. The ATL implementation returns S_OK.
DoVerb Helper Methods |
DoVerbDiscardUndo | Tells the control to discard any undo state it is maintaining.
DoVerbHide | Tells the control to remove its user interface from view.
DoVerbInPlaceActivate | Runs the control and installs its window, but does not install the control's user interface.
DoVerbOpen | Causes the control to be open-edited in a separate window.
DoVerbPrimary | Performs the specified action when the user double-clicks the control. The control defines the action, usually to activate the control in-place.
DoVerbShow | Shows a newly inserted control to the user.
DoVerbUIActivate | Activates the control in-place and shows the control's user interface, such as menus and toolbars.

See Also

IOleObjectImpl Overview


IOleObjectImpl::Advise

This method establishes an advisory connection with the control.

Syntax

HRESULT Advise( IAdviseSink* pAdvSink, DWORD* pdwConnection );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::Advise , IOleObjectImpl::Unadvise


IOleObjectImpl::Close

This method Changes the control from the running to the loaded state. Deactivates the control and destroys the control window if it exists. If the control class data member m_bRequiresSave is TRUE and the dwSaveOption parameter is either OLECLOSE_SAVEIFDIRTY or OLECLOSE_PROMPTSAVE, the control properties are saved before closing.

Syntax

HRESULT Close( DWORD dwSaveOption );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::Close


IOleObjectImpl::DoVerb

This method tells the control to perform one of its enumerated actions.

Syntax

HRESULT DoVerb( LONG iVerb, LPMSG lpmsg, IOleClientSite* pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::DoVerb


IOleObjectImpl::DoVerbDiscardUndo

This method tells the control to discard any undo state it is maintaining.

Syntax

HRESULT DoVerbDiscardUndo( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods


IOleObjectImpl::DoVerbHide

This method tells the control to discard any undo state it is maintaining.

Syntax

HRESULT DoVerbHide( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObjectImpl::DoVerbShow


IOleObjectImpl::DoVerbInPlaceActivate

This method activates the control in place. If activation succeeds, the function notifies the container the control has been activated.

Syntax

HRESULT DoVerbInPlaceActivate( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, CComControl::InPlaceActivate , CComControl::m_bWindowOnly


IOleObjectImpl::DoVerbOpen

This method causes the control to be open-edited in a separate window.

Syntax

HRESULT DoVerbOpen( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods


IOleObjectImpl::DoVerbPrimary

This method defines the action taken when the user double-clicks the control. By default, set to display the property pages. You can override this in your control class to invoke a different behavior on double-click; for example, play a video or go in-place active.

Syntax

HRESULT DoVerbPrimary( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, CComControl::DoVerbProperties


IOleObjectImpl::DoVerbShow

This method tells the container to make the control visible.

Syntax

HRESULT DoVerbShow( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObjectImpl::DoVerbHide


IOleObjectImpl::DoVerbUIActivate

This method activates the control's user interface and notifies the container that its menus are being replaced by composite menus.

Syntax

HRESULT DoVerbUIActivate( LPCRECT prcPosRect, HWND hwndParent );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, CComControl::InPlaceActivate


IOleObjectImpl::EnumAdvise

This method supplies an enumeration of registered advisory connections for this control.

Syntax

HRESULT EnumAdvise( IEnumSTATDATA** ppenumAdvise );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::EnumAdvise


IOleObjectImpl::GetClientSite

This method puts the pointer in the control class data member * m_spClientSite into ppClientSite and increments the reference count on the pointer.

Syntax

HRESULT GetClientSite( IOleClientSite** ppClientSite );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::GetClientSite


IOleObjectImpl::GetClipboardData

This method retrieves data from the Clipboard. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetClipboardData( DWORD dwReserved, IDataObject** ppDataObject );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::GetClipboardData


IOleObjectImpl::GetExtent

This method retrieves a running control's display size in HIMETRIC units (0.01 millimeter per unit). The size is stored in the control class data member m_sizeExtent.

Syntax

HRESULT GetExtent( DWORD dwDrawAspect, SIZEL* psizel );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::GetExtent , IOleObjectImpl::SetExtent


IOleObjectImpl::GetMoniker

This method retrieves the control's moniker. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetMoniker( DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::GetMoniker


IOleObjectImpl::GetUserClassID

This method returns the control's class identifier.

Syntax

HRESULT GetUserClassID( CLSID* pClsid );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::GetUserClassID


IOleObjectImpl::InitFromData

This method initializes the control from selected data. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT InitFromData( IDataObject* pDataObject, BOOL fCreation, DWORD dwReserved );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::InitFromData


IOleObjectImpl::IsUpToDate

This method checks to see if the control is up to date. The ATL implementation returns S_OK.

Syntax

HRESULT IsUpToDate( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::IsUpToDate


IOleObjectImpl::SetClientSite

This method uses pClientSite as the pointer to the control's client site and stores pClientSite in the control class data member m_spClientSite. The method then returns S_OK.

Syntax

HRESULT SetClientSite( IOleClientSite* pClientSite );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::SetClientSite


IOleObjectImpl::SetColorScheme

This method recommends a color scheme to the control's application if any. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT SetColorScheme( LOGPALETTE* pLogPal );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::SetColorScheme


IOleObjectImpl::SetExtent

This method sets the extent of the control's display area.

Syntax

HRESULT SetExtent( DWORD dwDrawAspect, SIZEL* psizel );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::SetExtent , IOleObjectImpl::GetExtent, CComControl::SendOnDataChange, CComControl::SendOnViewChange


IOleObjectImpl::SetHostNames

This method tells the control the container names.

Syntax

HRESULT SetHostNames( LPCOLESTR szContainerApp, LPCOLESTR szContainerObj );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::SetHostNames


IOleObjectImpl::SetMoniker

This method retrieves the control's moniker. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT SetMoniker( DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::SetMoniker


IOleObjectImpl::Unadvise

This method deletes the advisory connection stored in the control class's m_spOleAdviseHolder data member.

Syntax

HRESULT Unadvise( DWORD dwConnection );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::Unadvise , IOleObjectImpl::Advise


IOleObjectImpl::Update

This method updates the conrol. The ATL implementation returns S_OK.

Syntax

HRESULT Update( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IOleObjectImpl Overview, IOleObjectImpl Methods, IOleObject::Update


IPerPropertyBrowsingImpl

The IPerPropertyBrowsingImpl class implements the IPerPropertyBrowsing interface which allows a client to access the information in an object's property pages.

Syntax

template< class T >
class IPerPropertyBrowsingImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPerPropertyBrowsingImpl Methods, IPerPropertyBrowsing ,


IPerPropertyBrowsingImpl Methods

IPerPropertyBrowsing Methods |
GetDisplayString | Retrieves a string describing a given property.
GetPredefinedStrings | Retrieves an array of strings corresponding to the values that a given property can accept.
GetPredefinedValue | Retrieves a VARIANT containing the value of a property identified by a given DISPID. The DISPID is associated with the string name retrieved from GetPredefinedStrings. The ATL implementation returns E_NOTIMPL.
MapPropertyToPage | Retrieves the CLSID of the property page associated with a given property.

See Also

IPerPropertyBrowsingImpl Overview


IPerPropertyBrowsingImpl::GetDisplayString

This method retrieves a string describing a given property.

Syntax

HRESULT GetDisplayString( DISPID dispID, BSTR* pBstr );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPerPropertyBrowsingImpl Overview, IPerPropertyBrowsingImpl Methods, IPerPropertyBrowsing::GetDisplayString


IPerPropertyBrowsingImpl::GetPredefinedStrings

This method fills each array with zero items. ATL's implementation of GetPredefinedValue returns E_NOTIMPL.

Syntax

HRESULT GetPredefinedStrings( DISPID dispID, CALPOLESTR* pCaStringsOut, CADWORD* pCaCookiesOut );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPerPropertyBrowsingImpl Overview, IPerPropertyBrowsingImpl Methods, IPerPropertyBrowsing::GetPredefinedStrings


IPerPropertyBrowsingImpl::GetPredefinedValue

This method retrieves a VARIANT containing the value of a property identified by a given DISPID. The DISPID is associated with the string name retrieved from GetPredefinedStrings. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetPredefinedValue( DISPID dispID, DWORD dwCookie, VARIANT* pVarOut );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPerPropertyBrowsingImpl Overview, IPerPropertyBrowsingImpl Methods, IPerPropertyBrowsing::GetPredefinedValue


IPerPropertyBrowsingImpl::MapPropertyToPage

This method retrieves the CLSID of the property page associated with the specified property. ATL uses the object's property map to obtain this information.

Syntax

HRESULT MapPropertyToPage( DISPID dispID, CLSID* pClsid );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPerPropertyBrowsingImpl Overview, IPerPropertyBrowsingImpl Methods, IPerPropertyBrowsing::MapPropertyToPage ,


IPersistPropertyBagImpl

The IPersistPropertyBagImpl class implements the IPersistPropertyBag interface which allows an object to save its properties to a client-supplied property bag.

Syntax

template< class T >
class IPersistPropertyBagImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistPropertyBagImpl Methods, IErrorLog, IPersistPropertyBag , IPropertyBag


IPersistPropertyBagImpl Methods

IPersist Methods |
GetClassID | Retrieves the object's CLSID.
IPersistPropertyBag Methods |
InitNew | Initializes a newly created object. The ATL implementation returns S_OK.
Load | Loads the object's properties from a client-supplied property bag.
Save | Saves the object's properties into a client-supplied property bag.

See Also

IPersistPropertyBagImpl Overview


IPersistPropertyBagImpl::GetClassID

This method retrieves the object's CLSID.

Syntax

HRESULT GetClassID( CLSID *pClassID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistPropertyBagImpl Overview, IPersistPropertyBagImpl Methods, IPersist::GetClassID


IPersistPropertyBagImpl::InitNew

This method initializes a newly created object. The ATL implementation returns S_OK.

Syntax

HRESULT InitNew( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistPropertyBagImpl Overview, IPersistPropertyBagImpl Methods, IPersistPropertyBag::InitNew


IPersistPropertyBagImpl::Load

This method loads the object's properties from a client-supplied property bag. ATL uses the object's property map to retrieve this information.

Syntax

HRESULT Load( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistPropertyBagImpl Overview, IPersistPropertyBagImpl Methods, IErrorLog, IPersistPropertyBag::Load , IPersistPropertyBagImpl::Save, IPropertyBag


IPersistPropertyBagImpl::Save

This method saves the object's properties into a client-supplied property bag. ATL uses the object's property map to store this information. By default, this method saves all properties, regardless of the value of fSaveAllProperties.

Syntax

HRESULT Save( LPPROPERTYBAG pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistPropertyBagImpl Overview, IPersistPropertyBagImpl Methods, IPersistPropertyBag::Save, IPersistPropertyBagImpl:Load, IPropertyBag


IPersistStorageImpl

The IPersistStorageImpl class implements the IPersistStorage interface which allows a client to request that your object load and save its persistent data using a storage.

Syntax

template< class T >
class IPersistStorageImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Methods, IPersistStorage


IPersistStorageImpl Methods

Class Methods |
GetClassID | Retrieves the object's CLSID.
IpersistStorage Methods |
HandsOffStorage | Instructs the object to release all storage objects and enter HandsOff mode. The ATL implementation returns S_OK.
InitNew | Initializes a new storage.
IsDirty | Checks whether the object's data has changed since it was last saved.
Load | Loads the object's properties from the specified storage.
Save | Saves the object's properties to the specified storage.
SaveCompleted | Notifies an object that it can return to Normal mode to write to its storage object. The ATL implementation returns S_OK.

See Also

IPersistStorageImpl Overview


IPersistStorageImpl::GetClassID

This method retrieves the object's CLSID.

Syntax

HRESULT GetClassID( CLSID *pClassID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Overview, IPersistStorageImpl Methods, IPersist::GetClassID


IPersistStorageImpl::HandsOffStorage

This method instructs the object to release all storage objects and enter HandsOff mode. The ATL implementation returns S_OK.

Syntax

HRESULT HandsOffStorage( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Overview, IPersistStorageImpl Methods, IPersistStorage::HandsOffStorage , IPersistStorageImpl::SaveCompleted, IPersistStorageImpl::Save


IPersistStorageImpl::InitNew

This method initializes a new storage. The ATL implementation delegates to the IPersistStreamInit interface.

Syntax

HRESULT InitNew( IStorage* pStorage );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Overview, IPersistStorageImpl Methods, IPersistStorage::InitNew , IStorage


IPersistStorageImpl::IsDirty

This method checks whether the object's data has changed since it was last saved. The ATL implementation delegates to the IPersistStreamInit interface.

Syntax

HRESULT IsDirty( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Overview, IPersistStorageImpl Methods, IPersistStorage::IsDirty , IPersistStreamInit


IPersistStorageImpl::Load

This method loads the object's properties. The ATL implementation delegates to the IPersistStreamInit interface. Load uses a stream named "Contents" to retrieve the object's data. The Save method originally creates this stream.

Syntax

HRESULT Load( IStorage* pStorage );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Overview, IPersistStorageImpl Methods, IPersistStorage::Load , IPersistStreamInitImpl, IStorage


IPersistStorageImpl::Save

This method Saves the object's properties. The ATL implementation delegates to the IPersistStreamInit interface. When Save is first called, it creates a stream named "Contents" on the specified storage. This stream is then used in later calls to Save and in calls to Load.

Syntax

HRESULT Save( IStorage* pStorage, BOOL fSameAsLoad );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Overview, IPersistStorageImpl Methods, IPersistStorage::Save , IPersistStreamInitImpl, IPersistStorageImpl::SaveCompleted, IStorage


IPersistStorageImpl::SaveCompleted

This method notifies an object that it can return to Normal mode to write to its storage object. The ATL implementation returns S_OK.

Syntax

HRESULT SaveCompleted( IStorage* pStorage );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStorageImpl Overview, IPersistStorageImpl Methods, IPersistStorage::SaveCompleted , IPersistStorageImpl::HandsOffStorage, IPersistStorageImpl::Save, IStorage


IPersistStreamInitImpl

The IPersistStreamInitImpl class implements the IPersistStreamInit interface which allows a client to request that your object load and save its persistent data to a single stream.

Syntax

template< class T >
class IPersistStreamInitImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStreamInitImpl Methods, IPersistStreamInit


IPersistStreamInitImpl Methods

IPersist Methods |
GetClassID | Retrieves the object's CLSID.
IpersistStreamInit Methods |
GetSizeMax | Retrieves the size of the stream needed to save the object's data. The ATL implementation returns E_NOTIMPL.
InitNew | Initializes a newly created object.
IsDirty | Checks whether the object's data has changed since it was last saved.
Load | Loads the object's properties from the specified stream.
Save | Saves the object's properties to the specified stream.

See Also

IPersistStreamInitImpl Overview


IPersistStreamInitImpl::GetClassID

This method Retrieves the object's CLSID.

Syntax

HRESULT GetClassID( CLSID *pClassID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStreamInitImpl Overview, IPersistStreamInitImpl Methods, IPersist::GetClassID


IPersistStreamInitImpl::GetSizeMax

This method retrieves the size of the stream needed to save the object's data. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetSizeMax( ULARGE_INTEGER FAR* pcbSize );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStreamInitImpl Overview, IPersistStreamInitImpl Methods, IPersistStreamInit::GetSizeMax


IPersistStreamInitImpl::InitNew

This method initializes a newly created object.

Syntax

HRESULT InitNew( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStreamInitImpl Overview, IPersistStreamInitImpl Methods, IPersistStreamInit::InitNew


IPersistStreamInitImpl::IsDirty

This method checks whether the object's data has changed since it was last saved.

Syntax

HRESULT IsDirty( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStreamInitImpl Overview, IPersistStreamInitImpl Methods, IPersistStreamInit::IsDirty


IPersistStreamInitImpl::Load

This method loads the object's properties from the specified stream. ATL uses the object's property map to retrieve this information.

Syntax

HRESULT Load( LPSTREAM pStm );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStreamInitImpl Overview, IPersistStreamInitImpl Methods, IPersistStreamInit::Load , IPersistStreamInitImpl::Save, IStream


IPersistStreamInitImpl::Save

This method saves the object's properties to the specified stream. ATL uses the object's property map to store this information.

Syntax

HRESULT Save( LPSTREAM pStm, BOOL fClearDirty );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPersistStreamInitImpl Overview, IPersistStreamInitImpl Methods, IPersistStreamInit::Save , IPersistStreamInitImpl::Load, IStream


IPointerInactiveImpl

The IPointerInactiveImpl class implements the IPointerInactive interface which allows an object to support a minimal level of mouse interaction while remaining inactive. This functionality is particularly useful for controls.

Syntax

template< class T >
class IPointerInactiveImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPointerInactiveImpl Methods, IPonterInactive


IPointerInactiveImpl Methods

IPointerInactive Methods |
GetActivationPolicy | Retrieves the current activation policy for the object. The ATL implementation returns E_NOTIMPL.
OnInactiveMouseMove | Notifies the object that the mouse pointer has moved over it, indicating the object can fire mouse events. The ATL implementation returns E_NOTIMPL.
OnInactiveSetCursor | Sets the mouse pointer for the inactive object. The ATL implementation returns E_NOTIMPL.

See Also

IPointerInactiveImpl Overview


IPointerInactiveImpl::GetActivationPolicy

This method retrieves the current activation policy for the object. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetActivationPolicy( DWORD* pdwPolicy );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPointerInactiveImpl Overview, IPointerInactiveImpl Methods, IPointerInactive::GetActivationPolicy


IPointerInactiveImpl::OnInactiveMouseMove

This method notifies the object that the mouse pointer has moved over it, indicating the object can fire mouse events. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT OnInactiveMouseMove( LPCRECT pRectBounds, long x, long y, DWORD dwMouseMsg );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPointerInactiveImpl Overview, IPointerInactiveImpl Methods, IPointerInactive::OnInactiveMouseMove


IPointerInactiveImpl::OnInactiveSetCursor

This method sets the mouse pointer for the inactive object. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT OnInactiveSetCursor( LPCRECT pRectBounds, long x, long y, DWORD dwMouseMsg, BOOL fSetAlways);

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPointerInactiveImpl Overview, IPointerInactiveImpl Methods, IPointerInactive::OnInactiveSetCursor


IPropertyNotifySinkCP

The IPropertyNotifySink interface allows a sink object to receive notifications about property changes. Class IPropertyNotifySinkCP exposes this interface as an outgoing interface on a connectable object. The client must implement the IPropertyNotifySink methods on the sink.

Derive your class from IPropertyNotifySinkCP when you want to create a connection point that represents the IPropertyNotifySink interface.

IPropertyNotifySink is derived from IConnectionPointImpl. IConnectionPointImpl implements a connection point, which allows an object to expose an outgoing interface to the client.

Syntax

template< class T, class CDV = CComDynamicUnkArray >
class IPropertyNotifySinkCP :
public IConnectionPointImpl< T, &IID_IPropertyNotifySink, CDV >

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyNotifySink , IConnectionPointImpl, IConnectionPointContainerImpl


IPropertyPageImpl

The IPropertyPageImpl class implements the IPropertyPage interface which allows an object to manage a particular property page within a property sheet.

Syntax

template< class T >
class IPropertyPageImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

Remarks

ATL for Windows CE does not support the Help or OnStyleChange methods of the IPropertyPageImpl class.

See Also

IPropertyPageImpl Methods, IPropertyPageImpl Data Members, IPerPropertyBrowsingImpl , IPropertyPage, IPropertyPage2Impl, ISpecifyPropertyPagesImpl


IPropertyPageImpl Methods

Class Methods |
IPropertyPageImpl | Constructor
SetDirty | Flags the property page's state as changed or unchanged.
IPropertyPage Methods |
Activate | Creates the dialog box window for the property page.
Apply | Applies current property page values to the underlying objects specified through SetObjects. The ATL implementation returns S_OK.
Deactivate | Destroys the window created with Activate.
GetPageInfo | Retrieves information about the property page.
IsPageDirty | Indicates whether the property page has changed since it was activated.
Move | Positions and resizes the property page dialog box.
SetObjects | Provides an array of IUnknown pointers for the objects associated with the property page. These objects receive the current property page values through a call to Apply.
SetPageSite | Provides the property page with an IPropertyPageSite pointer, through which the property page communicates with the property frame.
Show | Makes the property page dialog box visible or invisible.
TranslateAccelerator | Processes a specified keystroke.

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members


IPropertyPageImpl::Activate

This method creates the dialog box window for the property page. By default, the dialog box is always modeless, regardless of the value of the bModal parameter.

Syntax

HRESULT Activate( HWND hWndParent, LPCRECT pRect, BOOL bModal );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::Activate, IPropertyPageImpl::Deactivate


IPropertyPageImpl::Apply

This method applies current property page values to the underlying objects specified through SetObjects. The ATL implementation returns S_OK.

Syntax

HRESULT Apply( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::Apply , IPropertyPageImpl::SetObjects


IPropertyPageImpl::Deactivate

This method destroys the dialog box window created with Activate.

Syntax

HRESULT Deactivate( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::Deactivate


IPropertyPageImpl::GetPageInfo

This method fills the pPageInfo structure with information contained in the data members. GetPageInfo loads the string resources associated with m_dwDocString, m_dwHelpFile, and m_dwTitle.

Syntax

HRESULT GetPageInfo( PROPPAGEINFO* pPageInfo );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::GetPageInfo , IPropertyPageImpl::m_size, IPropertyPageImpl::m_dwDocString, IPropertyPageImpl::m_dwHelpFile, IPropertyPageImpl::m_dwTitle


IPropertyPageImpl::IPropertyPageImpl

This method is the constructor for IPropertyPageImpl. It initializes all data members.

Syntax

IPropertyPageImpl( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods


IPropertyPageImpl::IsPageDirty

This method indicates whether the property page has changed since it was activated.

Syntax

HRESULT IsPageDirty( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::IsPageDirty , IPropertyPageImpl::SetDirty


IPropertyPageImpl::Move

This method repositions and resizes the property page dialog box.

Syntax

HRESULT Move( LPCRECT pRect );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::Move


IPropertyPageImpl::SetDirty

This method flags the property page's state as changed or unchanged, depending on the value of bDirty. If necessary, SetDirty informs the frame that the property page has changed.

Syntax

void SetDirty( BOOL bDirty );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::SetDirty , IPropertyPageImpl::IsPageDirty, IPropertyPageImpl::m_bDirty, IPropertyPageImpl::SetPageSite


IPropertyPageImpl::SetObjects

This method provides an array of IUnknown pointers for the objects associated with the property page.

Syntax

HRESULT SetObjects( ULONG nObjects, IUnknown** ppUnk );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::SetObjects , IPropertyPageImpl::Apply, IPropertyPageImpl::m_nObjects, IPropertyPageImpl::m_ppUnk


IPropertyPageImpl::SetPageSite

This method provides the property page with an IProperyPageSite pointer, through which the property page communicates with the property frame.

Syntax

HRESULT SetPageSite( IPropertyPageSite* pPageSite );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::SetPageSite , IPropertyPageImpl::m_pPageSite, IPropertyPageSite


IPropertyPageImpl::Show

This method makes the property page dialog box visible or invisible.

Syntax

HRESULT Show( UINT nCmdShow );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::Show


IPropertyPageImpl::TranslateAccelerator

This method processes the keystroke specified in pMsg.

Syntax

HRESULT TranslateAccelerator( MSG* pMsg );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods, IPropertyPage::TranslateAccelerator , MSG


IPropertyPageImpl Data Members

Data Members |
m_bDirty | Specifies whether the property page's state has changed.
m_nObjects | Stores the number of objects associated with the property page.
m_dwHelpContext | Stores the context identifier for the help topic associated with the property page.
m_dwDocString | Stores the resource identifier associated with the text string describing the property page.
m_dwHelpFile | Stores the resource identifier associated with the name of the help file describing the property page.
m_dwTitle | Stores the resource identifier associated with the text string that appears in the tab for the property page.
m_pPageSite | Points to the IpropertyPageSite interface through which the property page communicates with the property frame.
m_ppUnk | Points to an array of IUnknown pointers to the objects associated with the property page.
m_size | Stores the height and width of the property page's dialog box, in pixels.

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Methods


IPropertyPageImpl::m_bDirty

This data member specifies whether the property page's state has changed.

Syntax

BOOL m_bDirty;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::IsPageDirty , IPropertyPageImpl::SetDirty


IPropertyPageImpl::m_nObjects

This data member stores the number of objects associated with the property page.

Syntax

ULONG m_nObjects;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::SetObjects


IPropertyPageImpl::m_dwHelpContext

This data member stores the context identifier for the help topic associated with the property page.

Syntax

DWORD m_dwHelpContext;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::GetPageInfo


IPropertyPageImpl::m_dwDocString

This data member stores the resource identifier associated with the text string that describes the property page.

Syntax

UINT m_dwDocString;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::GetPageInfo


IPropertyPageImpl::m_dwHelpFile

This data member stores the resource identifier associated with the name of the help file describing the property page.

Syntax

UINT m_dwHelpFile;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::GetPageInfo


IPropertyPageImpl::m_dwTitle

This data member stores the resource identifier associated with the text string that appears in the tab for the property page.

Syntax

UINT m_dwTitle;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::GetPageInfo


IPropertyPageImpl::m_pPageSite

This data member points to the IPropertyPageSite interface through which the property page communicates with the property frame.

Syntax

IPropertyPageSite* m_pPageSite;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::SetPageSite


IPropertyPageImpl::m_ppUnk

This data member points to an array of IUnknown pointers which point to the objects associated with the property page.

Syntax

IUnknown** m_ppUnk;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::SetObjects


IPropertyPageImpl::m_size

This data member stores the height and width of the property page's dialog box, in pixels.

Syntax

SIZE m_size;

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPageImpl Overview, IPropertyPageImpl Data Members, IPropertyPageImpl::GetPageInfo , SIZE


IPropertyPage2Impl

The IPropertyPage2 interface extends IPropertyPage by adding the EditProperty method. This method allows a client to select a specific property in a property page object.

Class IPropertyPage2Impl simply returns E_NOTIMPL for IPropertyPage2::EditProperty. However, it inherits the default implementation of IPropertyPageImpl.

When you create a property page, your class is typically derived from IPropertyPageImpl. To provide the extra support of IPropertyPage2, modify your class definition and override the EditProperty method.

Syntax

template< class T >
class IPropertyPage2Impl : public IPropertyPageImpl< T >

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPage2Impl Methods, IPropteryPage , IPropertyPage2, IPerPropertyBrowsingImpl, ISpecifyPropertyPagesImpl


IPropertyPage2Impl Methods

IPropertyPage Methods |
EditProperty | Specifies which property control will receive the focus when the property page is activated. The ATL implementation returns E_NOTIMPL.

See Also

IPropertyPage2Impl Overview


IPropertyPage2Impl::EditProperty

This method Specifies which property control will receive the focus when the property page is activated. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT EditProperty( DISPID dispID );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IPropertyPage2Impl Overview, IPropertyPage2Impl Methods, IPropertyPage2::EditProperty,


IProvideClassInfo2Impl

The IProvideClassInfo2Impl class implements the IProvideClassInfo2 interface. It also contains a static member of type CComTypeInfoHolder that manages the type information for the coclass.

Syntax

template< const CLSID* pcoclsid, const IID* psrcid, const GUID* plibid, WORD wMajor = 1, WORD wMinor = 0, class tihclass = CComTypeInfoHolder >
class IProvideClassInfo2Impl : public IProvideClassInfo2

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IProvideClassInfo2Impl Methods, IProvideClassInfo2Impl Data Members, IProvideClassInfo , IProvideClassInfo2


IProvideClassInfo2Impl Methods

Class Methods |
IProvideClassInfo2Impl | Constructor.
IProvideClassInfo Methods |
GetClassInfo | Retrieves an ItypeInfo pointer to the coclass' type information.
IprovideClassInfo2 Methods |
GetGuid | Retrieves the GUID for the object's outgoing dispinterface.

See Also

IProvideClassInfo2Impl Overview, IProvideClassInfo2Impl Data Members


IProvideClassInfo2Impl::GetClassInfo

This method retrieves an ITypeInfo pointer to the coclass type information.

Syntax

HRESULT GetClassInfo( ITypeInfo** pptinfo );

At a Glance

Header file: | Altcom.h
Platforms: |
Versions: | Version 2.0 and later
Complete documentation: | Visual C++ documentation

See Also

IProvideClassInfo2Impl Overview, IProvideClassInfo2Impl Methods, IProvideClassInfo::GetClassInfo , ITypeInfo


IProvideClassInfo2Impl::GetGUID

This method retrieves the GUID for the object's outgoing dispinterface.

Syntax

HRESULT GetGUID( DWORD dwGuidKind, GUID* pGUID );

At a Glance

Header file: | Altcom.h
Platforms: |
Versions: | Version 2.0 and later
Complete documentation: | Visual C++ documentation

See Also

IProvideClassInfo2Impl Overview, IProvideClassInfo2Impl Methods, IProvideClassInfo2::GetGUID


IProvideClassInfo2Impl::IProvideClassInfo2Impl

This class constructor calls AddRef on the _tih member. The destructor calls Release.

Syntax

IProvideClassInfo2Impl( );

At a Glance

Header file: | Altcom.h
Platforms: |
Versions: | Version 2.0 and later
Complete documentation: | Visual C++ documentation

See Also

IProvideClassInfo2Impl Overview, IProvideClassInfo2Impl Methods


IProvideClassInfo2Impl Data Members

Data Members |
tih | Manages the type information for the coclass.

See Also

IProvideClassInfo2Impl Overview, IProvideClassInfo2Impl Methods


IProvideClassInfo2Impl::_tih

This static data member is an instance of the class template parameter, tihclass, which by default is CComTypeInfoHolder, and manages the type information for the coclass.

Syntax

static tihclass _tih;

At a Glance

Header file: | Altcom.h
Platforms: |
Versions: | Version 2.0 and later
Complete documentation: | Visual C++ documentation

See Also

IProvideClassInfo2Impl Overview, IProvideClassInfo2Impl Data Members


IQuickActivateImpl

The IQuickActivateImpl class implements the IQuickActivate interface which helps containers avoid delays when loading controls by combining initialization in a single call.

Syntax

template< class T >
class IQuickActivateImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IQuickActivateImpl Methods, CComControl , IQuickActivate


IQuickActivateImpl Methods

IQuickActivate Methods |
GetContentExtent | Gets the extent of a full rendering of the control within the container.
QuickActivate | Performs quick initialization of controls being loaded.
SetContentExtent | Informs the control how much display space the container has assigned to it.

See Also

IQuickActivateImpl Overview


IQuickActivateImpl::GetContentExtent

This method retrieves the current display size for a running control. The size is for a full rendering of the control and is specified in HIMETRIC units.

Syntax

HRESULT GetContentExtent( LPSIZEL pSize );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IQuickActivateImpl Overview, IQuickActivateImpl Methods, IQuickActivate::GetContentExtent , IQuickActivateImpl::SetContentExtent


IQuickActivateImpl::QuickActivate

This method passes a pointer to a container to a QCONTAINER structure. The structure contains pointers to interfaces needed by the control and the values of some ambient properties. Upon return, the control passes a pointer to a QCONTROL structure that contains pointers to its own interfaces that the container requires, and additional status information.

Syntax

HRESULT QuickActivate( QACONTAINER *pQACont, QACONTROL *QACtrl );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IQuickActivateImpl Overview, IQuickActivateImpl Methods, IQuickActivate::QuickActivate


IQuickActivateImpl::SetContentExtent

This method informs a control of how much display space the container has assigned to it. The size is specified in HIMETRIC units.

Syntax

HRESULT SetContentExtent( LPSIZEL pSize );

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IQuickActivateImpl Overview, IQuickActivateImpl Methods, IQuickActivate::SetContentExtent , IQuickActivateImpl::GetContentExtent


IRunnableObjectImpl

The IRunnableObjectImpl class implements the IRunnableObject interface which enables a container to force a control to run, lock it into a running state, or determine if it is running.

Syntax

template< class T >
class IRunnableObjectImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IRunnableObjectImpl Methods, CComControl , IRunnableObject


IRunnableObjectImpl Methods

IRunnableObject Methods |
GetRunningClass | Returns the CLSID of the running control. The ATL implementation sets the CLSID to GUID_NULL and returns E_UNEXPECTED.
IsRunning | Determines if the control is running. The ATL implementation returns TRUE.
LockRunning | Locks the control into the running state. The ATL implementation returns S_OK.
Run | Forces the control to run. The ATL implementation returns S_OK.
SetContainedObject | Indicates that the control is embedded. The ATL implementation returns S_OK.

See Also

IRunnableObjectImpl Overview


IRunnableObjectImpl::GetRunningClass

This method returns the CLSID of the running control. The ATL implementation sets the *lpCLSID to GUID_NULL and returns E_UNEXPECTED.

Syntax

HRESULT GetRunningClass(LPCLSID lpClsid );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IRunnableObjectImpl Overview, IRunnableObjectImpl Methods, IRunnableObject::GetRunningClass


IRunnableObjectImpl::IsRunning

This method determines if the control is running. The ATL implementation returns TRUE.

Syntax

virtual BOOL IsRunning( );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IRunnableObjectImpl Overview, IRunnableObjectImpl Methods, IRunnableObject::IsRunning


IRunnableObjectImpl::LockRunning

This method locks the control into the running state. The ATL implementation returns S_OK.

Syntax

HRESULT LockRunning( BOOL fLock, BOOL fLastUnlockCloses );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IRunnableObjectImpl Overview, IRunnableObjectImpl Methods, IRunnableObject::LockRunning


IRunnableObjectImpl::Run

This method forces the control to run. The ATL implementation returns S_OK.

Syntax

HRESULT Run( LPBINDCTX );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IRunnableObjectImpl Overview, IRunnableObjectImpl Methods, IRunnableObject::Run


IRunnableObjectImpl::SetContainedObject

This method indicates that the control is embedded. The ATL implementation returns S_OK.

Syntax

HRESULT SetContainedObject( BOOL fContained );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IRunnableObjectImpl Overview, IRunnableObjectImpl Methods, IRunnableObject::SetContainedObject


ISpecifyPropertyPagesImpl

The ISpecifyPropertyPagesImpl class implements the ISpecifyPropertyPages interface which allows a client to obtain a list of CLSIDs for an object's property pages.

Syntax

template< class T >
class ISpecifyPropertyPagesImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

ISpecifyPropertyPagesImpl Methods, IPropertyPageImpl , IPerPropertyBrowsingImpl, ISpecifyPropertyPages


ISpecifyPropertyPagesImpl Methods

ISpecifyProperyPages Methods |
GetPages | Fills a Counted Array of UUID values, each of which corresponds to the CLSID for a property page that can be displayed in the property's sheet.

See Also

ISpecifyPropertyPagesImpl Overview


ISpecifyPropertyPagesImpl::GetPages

This method fills the array in the CAUUID structure with the CLSIDs for the property pages that can be displayed in the object's property sheet. ATL uses the object's property map to retrieve each CLSID.

Syntax

HRESULT GetPages(CAUUID* pPages );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

ISpecifyPropertyPagesImpl Overview, ISpecifyPropertyPagesImpl Methods, ISpecifyPropertyPages::GetPages


ISupportErrorInfoImpl

The ISupportErrorInfoImpl class implements the ISupportErrorInfo interface which supports error information flow.

Syntax

template< const IID* piid >
class ISupportErrorInfoImpl : public ISupportErrorInfo

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

ISupportErrorInfoImpl Methods, IErrorInfo


ISupportErrorInfoImpl Methods

ISupportErrorInfo Methods |
InterfaceSupportsErrorInfo | Indicates whether an interface supports the IErrorInfo interface.

See Also

ISupportErrorInfoImpl Overview, IErrorInfo


ISupportErrorInfoImpl::InterfaceSupportsErrorInfo

This method indicates whether the interface identified by riid supports the IErrorInfo interface.

Syntax

HRESULT InterfaceSupportsErrorInfo( REFIID riid );

At a Glance

Header file: Atlcom.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

ISupportErrorInfoImpl Overview, ISupportErrorInfoImpl Methods, ISupportErrorInfo::InterfaceSupportsErrorInfo


IViewObjectExImpl

The IViewObjectExImpl class implements the IViewObject, IViewObject2, and IViewObjectEx interfaces. These interfaces support a variety of control display features.

Syntax

template< class T >
class IViewObjectExImpl

At a Glance

Header file: Atlctl.h
Platforms:
Versions: 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Methods, CComControl, IViewObject, IViewObject2. IViewObjectEx


IViewObjectExImpl Methods

IViewObject Methods |
Draw | Draws a representation of the control onto a device context.
Freeze | Freezes the drawn representation of a control so that it won't change until an Unfreeze. The ATL implementation returns E_NOTIMPL.
GetAdvise | Returns information on the most recent SetAdvise.
GetColorset | Returns the logical palette used by the control for drawing. The ATL implementation returns E_NOTIMPL.
SetAdvise | Sets up an advise sink to receive notifications of changes in the view of the control.
UnFreeze | Unfreezes the drawn representation of the control. The ATL implementation returns E_NOTIMPL.
IViewObject2 Methods |
GetExtent | Retrieves the size of the control from the cache.
IViewObjectEx Methods |
GetNaturalExtent | Provides sizing hints from the container for the object to use as the user resizes it. The ATL implementation returns E_NOTIMPL.
GetRect | Returns a rectangle describing a requested drawing aspect. The ATL implementation returns E_NOTIMPL.
GetViewStatus | Returns information about the opacity of the object, and what drawing aspects are supported.
QueryHitPoints | Indicates whether a point is within a given drawing aspect of an object.
QueryHitRect | Indicates whether any point in a rectangle is within a given drawing aspect of an object.

See Also

IViewObjectExImpl Overview, CComControl


IViewObjectExImpl::Draw

This method calls CComControl::OnDrawAdvanced which in turn calls the OnDraw method of your control class. An OnDraw method is automatically added to your control class when you create your control with the ATL Object Wizard. The Wizard's default OnDraw draws a rectangle with the label "ATL 2.0".

Syntax

HRESULT Draw( DWORD dwDrawAspect, LONG lindex, void* pvAspect, DVTARGETDEVICE* ptd, HDC hicTargetDev, LPCRECTL prcBounds, LPCRECTL prcWBounds, BOOL(_stdcall * pfnContinue) (DWORD dwContinue), DWORD dwContinue );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, CComControl::OnDrawAdvanced, CComControl::OnDraw


IViewObjectExImpl::Freeze

This method freezes the drawn representation of a control so that it will not change until the Unfreeze method is called. This method returns E_NOTIMPL.

Syntax

HRESULT Freeze( DWORD dwAspect, LONG lindex, void* pvAspect, DWORD* pdwFreeze );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObject::Freeze


IViewObjectExImpl::GetAdvise

This method retrieves an existing advisory sink connection on the control, if there is one. The advisory sink is stored in the control class data member m spAdviseSink.

Syntax

HRESULT GetAdvise( DWORD* pAspects, DWORD* pAdvf, IAdviseSink** ppAdvSink );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObject::GetAdvise, IViewObjectExImpl::SetAdvise


IViewObjectExImpl::GetColorSet

This method returns the logical palette used by the control for drawing. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetColorSet( DWORD dwAspect, LONG lindex, void* pvAspect, DVTARGETDEVICE* ptd, HDC hicTargetDevice, LOGPALETTE** ppColorSet );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObject::GetColorSet


IViewObjectExImpl::GetExtent

This method retrieves the control's display size in HIMETRIC units (0.01 millimeter per unit) from the control class data member m_sizeExtent.

Syntax

HRESULT GetExtent( DWORD dwDrawAspect, LONG lindex, DVTARGETDEVICE* ptd, LPSIZEL* lpsizel );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObject2::GetExtent


IViewObjectExImpl::GetNaturalExtent

This method provides sizing hints from the container for the object to use as the user resizes it. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetNaturalExtent( DWORD dwAspect, LONG lindex, DVTARGETDEVICE* ptd, HDC hicTargetDevice, DVEXTENTINFO* pExtentInfo, LPSIZEL psizel );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObjectEx::GetNaturalExtent


IViewObjectExImpl::GetRect

This method returns a rectangle describing a requested drawing aspect. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT GetRect( DWORD dwAspect, LPRECTL pRect )

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObjectEx::GetRect


IViewObjectExImpl::GetViewStatus

This method returns information about the opacity of the object, and indicates which drawing aspects are supported.

Syntax

HRESULT GetViewStatus( DWORD* pdwStatus );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObjectEx::GetViewStatus


IViewObjectExImpl::QueryHitPoint

This method checks if the specified point is in the specified rectangle and returns a HITRESULT value in pHitResult. The value can be either HITRESULT_HIT or HITRESULT_OUTSIDE.

Syntax

HRESULT QueryHitPoint( DWORD dwAspect, LPCRECT pRectBounds, POINT ptlLoc, LONG lCloseHit, DWORD* pHitResult );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObjectEx::QueryHitPoint , IViewObjectExImpl::QueryHitRect


IViewObjectExImpl::QueryHitRect

This method checks whether the control's display rectangle overlaps any point in the specified location rectangle and returns a HITRESULT value in pHitResult. The value can be either HITRESULT_HIT or HITRESULT_OUTSIDE.

Syntax

HRESULT QueryHitRect( DWORD dwAspect, LPCRECT pRectBounds, LPRECT prcLoc, LONG lCloseHit, DWORD* pHitResult );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObjectEx::QueryHitRect, IViewObjectExImply::QueryHitPoint


IViewObjectExImpl::SetAdvise

This method sets up a connection between the control and an advise sink so that the sink can be notified about changes in the control's view. The pointer to the IAdviseSink interface on the advise sink is stored in the control class data member m_spAdviseSink.

Syntax

HRESULT SetAdvise( DWORD aspects, DWORD advf, IAdviseSink* pAdvSink );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObject::SetAdvise , IViewObjectExImpl::GetAdvise


IViewObjectExImpl::UnFreeze

This method unfreezes the drawn representation of the control. The ATL implementation returns E_NOTIMPL.

Syntax

HRESULT Unfreeze( DWORD dwFreeze );

At a Glance

Header file: Atlctl.h
Platforms:
Versions: Version 2.0 and later
Complete documentation: Visual C++ documentation

See Also

IViewObjectExImpl Overview, IViewObjectExImpl Methods, IViewObject::UnFreeze


Topic Not Found

No matching topic was found. Some possible reasons and remedies are as follows:

  • The file (.chm) that contains the destination topic is not in the expected location.

Remedy: Rerun the MSDN Library Setup.

  • The file (.chm) that contains the current topic or destination topic is out-of-date and the link is no longer valid.

Remedy: Install the latest version of the MSDN Library.

  • The MSDN Library CD is not in the CD-ROM drive.

Remedy: Insert the MSDN Library CD into the CD-ROM drive.