CComModule Replacement Classes
💁 ATL's earlier iterations made use of CComModule. The functionality of CComModule is replaced by a number of classes in ATL 7.0:
☑️ Most applications that use ATL will need the information found in CAtlBaseModule. Contains the resource instance's HINSTANCE as well as the module's HINSTANCE.
☑️ The ATL COM classes' information is contained in the CAtlComModule.
☑️ Information needed by the ATL windowing classes is contained in the CAtlWinModule.
☑️ Support for interface debugging is provided by the CAtlDebugInterfacesModule.
☑️ CAtlModule The information needed in each of the following CAtlModule-derived classes is specific to that application type. The majority of these classes' members can be overridden:
✅ CAtlDllModuleT utilised in DLL software. code for the common exports is provided.
✅ CAtlExeModuleT used by EXE programmes. provides the code needed for an EXE.
✅ Create Windows NT and Windows 2000 Services with the help of the CAtlServiceModuleT.
Reasons for Distributing CComModule Functionality
📁 For the following reasons, CComModule's functionality was split up into a number of new classes:
✔️ Make CComModule's functionality more precise.
Application-specific (DLL or EXE) functionality, windowing, interface debugging, and COM support are now all in separate classes.
✔️ Declare a global instance of each of these modules automatically.
The relevant module classes are integrated into the project as a global instance.
✔️ Eliminate the need to invoke the Term and Init procedures.
There is no longer a requirement to call Init and Term because these methods have been relocated into the constructors and destructors for the module classes.
Also see, Application of Oops
Frequently Asked Questions
What is an ATL application?
Microsoft created a collection of template-based C++ classes called the Active Template Library (ATL) to make programming Component Object Model (COM) objects easier. Developers can create different COM objects, OLE Automation servers, and ActiveX controls thanks to the COM support in Microsoft Visual C++.
What is ATL?
Active Template Library (ATL), a collection of C++ classes built using templates, makes it easier to programme Component Object Model (COM) objects. For building and consuming software components on Windows, COM is a binary specification. It is strongly advised to be familiar with COM to better use ATL.
What are ATL and MFC?
A C++ object-oriented wrapper for Win32 is provided by the Microsoft Foundation Classes (MFC) to facilitate the quick building of native desktop programs. ActiveX controls are frequently created using the Active Template Library (ATL), a wrapper library that makes COM development easier.
Conclusion
Congratulations on finishing the blog! We have discussed the details of ATL module classes, in which we discuss CComModule Replacement Classes and Reasons for Distributing CComModule Functionality.
We hope this blog has helped you enhance your knowledge of ATL module classes. If you'd like to learn more, Check out the following links:
🔥 Classes and Objects
🔥 Constructors and Destructors
🔥 Access specifier
Please refer to our guided pathways on Code studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enroll in our courses, and use the accessible sample exams and questions as a guide. For placement preparations, look at the interview experiences and interview package.
Please upvote 🏆 our blogs 🎈 if you find them helpful and informative!
Happy coding🤗