Table of contents
1.
Introduction
2.
IOleInPlaceObjectWindowlessImpl Class
3.
Members of IOleInPlaceObjectWindowlessImpl Class
3.1.
ContextSensitiveHelp
3.2.
GetDropTarget
3.3.
GetWindow
3.4.
InPlaceDeactivate
3.5.
OnWindowMessage
3.6.
ReactivateAndUndo
3.7.
SetObjectRects
3.8.
UIDeactivate
4.
Frequently Asked Questions
4.1.
What are classes in ATL?
4.2.
What is ATL?
4.3.
What are C++ templates?
4.4.
What are some ATL applications?
4.5.
What does Windows' COM object mean?
5.
Conclusion
Last Updated: Mar 27, 2024
Easy

UI Support Class-IOleInPlaceObjectWindowlessImpl

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

With the use of C++ language, community help for C++ has also increased. Adding various libraries in C++ eases the programmer's efforts by far. This article will discuss a class of a library developed by Microsoft, which is gaining a lot of popularity these days. The active template library (ATL) of Microsoft.

UI support class-IOleInPlaceObjectWindowlessImpl

This article will discuss one of the UI support classes of ATL, IOleInPlaceObjectWindowlessImpl. We will briefly discuss this support class along with its member functions. We will also discuss their syntaxes and where to add those member functions. So without further ado, let’s get started!

IOleInPlaceObjectWindowlessImpl Class

The IOleInPlaceObjectWindowlessImpl is a type of UI support class. It implements IUnknown and contains various methods. These methods allow a windowless control to receive window messages and drag-and-drop operations. Following is the header file and syntax for adding this support class to your program.

IOleInPlaceObjectWindowlessImpl

Header file to be included

#include<atlctl.h>
You can also try this code with Online C++ Compiler
Run Code

 

Syntax

template<class T>
class IOleInPlaceObjectWindowlessImpl
You can also try this code with Online C++ Compiler
Run Code

 

In this article, we will discuss various members of this class in detail.

Before starting, you should know about the hierarchy structure of the UI support classes. The IOleInPlaceObject interface controls the reactivation and deactivation of in-place controls and the visible amount of control. The IOleInPlaceObjectWindowless interface allows a windowless control to receive window messages and drag-and-drop operations. In debug builds, the class IOleInPlaceObjectWindowlessImpl provides a default implementation of IOleInPlaceObject and IOleInPlaceObjectWindowless, as well as an implementation of IUnknown by delivering information to the dump device.

Members of IOleInPlaceObjectWindowlessImpl Class

We have various members of this support class which enable windowless operations. Following are the members provided by this support class.

ContextSensitiveHelp

It is a public method of the member class. It allows for context-sensitive help. 

Syntax

HRESULT ContextSensitiveHelp(BOOL fEnterMode);
You can also try this code with Online C++ Compiler
Run Code

 

The ATL implementation of this method will return E_NOTIMPL.

GetDropTarget

It provides the IDropTarget interface for an active, windowless in-place object that supports drag and drop. 

Syntax

HRESULT GetDropTarget(IDropTarget** ppDropTarget);
You can also try this code with Online C++ Compiler
Run Code

 

The ATL implementation of this method will return E_NOTIMPL.

GetWindow

The container calls this function to obtain the control's window handle. It is one of the public class methods.

Some containers will not operate with a windowless control, even if it is currently windowed. If the control class's data member m_bWasOnceWindowless is TRUE in ATL's implementation, the function returns E_FAIL. Otherwise, if it is not NULL, GetWindow sets * phwnd to the data member m_hWnd of the control class.

Syntax

HRESULT GetWindow(HWND* phwnd);
You can also try this code with Online C++ Compiler
Run Code

 

This function's ATL implementation always returns S_OK.

InPlaceDeactivate

For this method of the IOleInPlaceObjectWindowlessImpl, the container has requested that an in-place active control should be deactivated. Depending on the control status, this technique conducts full or partial deactivation. If necessary, the control's user interface is deactivated, and the control's window, if any, is removed. The container is informed that the control is no longer active. The container's IOleInPlaceUIWindow interface for negotiating menus and border space is freed.

Syntax

HRESULT InPlaceDeactivate(HWND* phwnd);
You can also try this code with Online C++ Compiler
Run Code

OnWindowMessage

This member of IOleInPlaceObjectWindowlessImpl will send a message from a container to an in-place active windowless control. It also belongs to the public method class.

Syntax

HRESULT OnWindowMessage(
    UINT msg,
    WPARAM WParam,
    LPARAM LParam,
    LRESULT plResultParam);
You can also try this code with Online C++ Compiler
Run Code

ReactivateAndUndo

This public class method will reactivate the previously deactivated control. It basically undoes the previously taken control action.

Syntax

HRESULT ReactivateAndUndo();
You can also try this code with Online C++ Compiler
Run Code

 

The ATL implementation of this method will return E_NOTIMPL.

SetObjectRects

By using this method, the container calls the function to notify the control that its size and/or the position has changed. The control's m_rcPos data member and the controlled display are updated afterwards. The only part of the control that intersects the clip zone is visible if needed. If the display of a control was previously clipped, but the clipping has been eliminated, this function can be used to redraw the control's full view.

Syntax

HRESULT SetObjectRects(LPCRECT prcPos, LPCRECT prcClip);
You can also try this code with Online C++ Compiler
Run Code

UIDeactivate

This member class deactivates and removes the user interface for the control that supports in-place activation. It is also a public method class. It sets up the data member m_bUIActive of the control class to FALSE. 

Syntax

HRESULT UIDeactivate();
You can also try this code with Online C++ Compiler
Run Code

 

This function's ATL implementation always returns S_OK.

Frequently Asked Questions

What are classes in ATL?

Classes in Active Template Library(ATL) contain important data to display in different directions like metafile, printer, or ActiveX control. Class instance data in the ATL windowing code.

What is ATL?

Active Template Library is a collection of C++ classes that are template based to make writing Component Object Model(COM) objects easier. 

What are C++ templates?

In C++, templates are an effective tool for passing data types as parameters to generalised functions.

What are some ATL applications?

The Active Template Library (ATL), a wrapper library that facilitates COM development, is frequently used to create ActiveX controls. Applications written in MFC or ATL can be made using Visual Studio Community Edition or higher.

What does Windows' COM object mean?

The Microsoft Component Object Model is a distributed, object-oriented method for creating binary software components that can communicate (COM).

Conclusion

This article discussed the UI support class IOleInPlaceObjectWindowlessImpl. We discussed members of the IOleInPlaceObjectWindowlessImplclass in detail. We hope this blog has helped you enhance your knowledge on the topic of the UI support class IOIeInPlaceObjectWindowlessImpl. If you like to learn more, you can check out our articles: 

Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptAWS and many more! If you wish to test your competency in coding, check out the mock test series and take part in the contests hosted on Coding Ninjas Studio! 

If you have started your learning process and are looking for questions from tech giants like Amazon, Microsoft, Uber, etc. For placement preparations, you must look at the problemsinterview experiences, and interview bundles.

Nevertheless, consider our paid courses to give your career an edge over others!

Happy Learning!

Live masterclass