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 4032200
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:41:30+00:00 2026-05-20T11:41:30+00:00

I am updating an MFC application that contains a custom ActiveX control. As a

  • 0

I am updating an MFC application that contains a custom ActiveX control. As a part of the update I have had cause to add new methods to the ActiveX control and so it now has a different interface to the old version. The changes had no impact on the original methods and so older clients can still use the new component.

I’ve got everything working but I know that what I have done is smelly! What is the correct way of updating a COM/ActiveX interface.

This component was built using MFC and Googling does not provide much help beyond basic ‘Create an ActiveX control with MFC’ type tutorials. I can find loads of stuff about ATL but I don’t want to port the component over.

I have had various suggestions from colleagues such as change the guids and inherit the interface but nothing definitive.

So generally what is considered best practise for updating COM interfaces?

And if you happen to know how this is specifically done in an MFC environment that would be really helpful too.

I’ve tried creating a second interface (see below) as suggested by MSalters but I’m not sure that I’ve gone about it correctly. I’ve created a new interface and a new coclass in the odl file. This results in two separate wrapper classes being generated by MFC in the client Application, one derived from CWnd for coclass Test and one derived from COleDispatchDriver for coclass Test2 – I would have expected two similar wrapper classes….

library TestLib
{
    importlib(STDOLE_TLB);

    // This is the original interface.......

    [ uuid(D2F8E5A8-8A95-463C-814F-B3CF84286223)]
    dispinterface _DTest
    {
        properties:
        methods:
            [id(1)] short TestMethod();
    };

    //  Class information for CTestCtrl
    [ uuid(1DBD2333-2073-4FB6-89AC-E4B200ADED48), control ]
    coclass Test
    {
        [default] dispinterface _DTest;
    };


    //  This is the new interface.

    [ uuid(D2F8E5A8-8A95-463C-814F-B3CF84286224)]
    dispinterface _DTest2
    {
        properties:
        methods:
            [id(1)] short TestMethod();
            [id(2)] short TestMethod2();
    };

    //  Class information for CTestCtrl2

    [ uuid(1DBD2333-2073-4FB6-89AC-E4B200ADED49), control ]
    coclass Test2
    {
        [default] dispinterface _DTest2;
    };
};
  • 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-05-20T11:41:31+00:00Added an answer on May 20, 2026 at 11:41 am

    Depends.

    If you do have customers that are compiling their own code (C++ or C# or VB) against your controls’s type library, .h file, or .idl file, you likely need to change the COM guids.

    Here are the cases where you don’t have to change the COM guids:

    1. No 3rd party developers are consuming your code. No one would be broken if you changed the interface.

    2. It’s an ActiveX control hosted in a webbrowser and accessed through Javascript.

    3. All the software depending on your COM DLL ships together with the updated version of your control.

    4. It’s “internal”. Anyone dependent can quickly recompile if needed.

    If any one of the above is true, then you don’t have to change COM guids. Just add the new methods to the existing interface declaration. Recompile all dependent software with the change.

    Here are the cases where you should be careful.

    1. Someone else has already compiled (C++, C#, or VB) and shipped software against your existing interface – and they can’t immediately upgrade when you ship. New methods should be declared on a new COM interface. The existing coclass declaration gets amended to support this interface as well.

    2. You are removing methods, changing behavior, or otherwise making a breaking change to shipping software. Change your guid on the CoClass such that it can possibly co-exist side by side with those dependent on the old version. Rename the DLL as well such that it doesn’t necessarily overwrite the old one on upgrade.

    In your above example, I don’t think you need to declare a new coclass – just a new interface. And your new interface doesn’t need to implement the methods of the first. Just make mark both interfaces on the coclass.

    dispinterface _DTest
    {
        properties:
        methods:
            [id(1)] short TestMethod();
    };
    
    //  This is the new interface.
    [ uuid(D2F8E5A8-8A95-463C-814F-B3CF84286224)]
    dispinterface _DTest2
    {
        properties:
        methods:
            [id(2)] short TestMethod2();
    };
    
    
    //  Class information for CTestCtrl
    [ uuid(1DBD2333-2073-4FB6-89AC-E4B200ADED48), control ]
    coclass Test
    {
        [default] dispinterface _DTest;
        dispinterface _DTest2;
    }
    

    };

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am updating an old MFC application that used WinHelp so that it now
Updating a column that is part of your selection criteria should be no problem
I'm working on updating the GUI of a native (MFC) application using .NET and
Since updating to the latest JQuery I have noticed that all my getJson calls
Updating an object with MVC3 I have a model that I can modify, please
I'm updating a VS6 MFC dialog application to VS2008. Updating the code has been
Updating live tiles from Background audio agent? I know that you can update Liva
Updating this Thread as I have had some other help solving why I was
After updating a bundle, you will have some gems that may be obsolete --
When updating a DataTable with 1850-ish new rows to a FbDataAdapter I get a

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.