Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8522751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:12:51+00:00 2026-06-11T07:12:51+00:00

I try to refactor an existing and working COM event sink implementation. The event

  • 0

I try to refactor an existing and working COM event sink implementation. The event sink class is written in C++ and resides in a DLL that uses the deprecated CComModule class. The goal of the refactoring is to replace CComModule by the new ATL 7.0 class CAtlComModule.

The existing implementation declares a global variable somewhere in a .cpp file:

CComModule _Module;

As you can see the variable has the usual “magic” name _Module. The customary initialization is missing, though, nowhere is there a call to CComModule::Init() and there is also no COM object map in the DLL project. The event sink still works, its event handler methods get properly called.

Lacking any documentation how to transition from CComModule to CAtlComModule, I naively attempted to change the variable declaration to this:

CAtlComModule _Module;

It didn’t work out, though: After the change the event sink stopped working, i.e. its event handler methods no longer get called.

Does anyone know the steps one is supposed to perform to migrate to CAtlComModule? So far I have been unable to dig up a solution either on MSDN or via Google, but maybe I did not look properly…

BTW: If necessary I can provide more details about the event sink implementation, but so far I felt that the problem is not in this area.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:12:53+00:00Added an answer on June 11, 2026 at 7:12 am

    The simplest “new style” replacement for CComModule looks like this:

    class MyModule : public CAtlDllModuleT<MyModule> {};
    MyModule _Module;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try: html = urlopen('http://glbse.com/api/asset/' + asset.name) except: print 'error while updating the price of
Try as I might I cannot get my head around what the IteratorIterator class
I'm trying to refactor an existing asp.net-mvc web application and introduce mvc-turbine. The application
I have an existing site that has a bunch of different models and controllers.
I've this Class Library, as a result of a refactor action. I added an
I'm trying to refactor a component that currently produces a Seq[X] using a fairly
Hi Guys could you please help me refactor this so that it is sensibly
Any ideas on a good way to refactor this so that my code acts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.