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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:22:01+00:00 2026-05-12T22:22:01+00:00

I have an ATL/COM-based DLL, written in VC++ 6.0. Until recently, there was a

  • 0

I have an ATL/COM-based DLL, written in VC++ 6.0. Until recently, there was a one-to-one correspondence between my COM interfaces and classes. For example, let’s say there was a ICar interface; then there was also a CCar class which implemented it, and no class other than CCar implemented ICar, and CCar implemented no interface (of mine) other than ICar. Similarly, IPlane and CPlane. The definitions might be something like:

ICar had functions “StepOnGas” and “MaxPassengers”; IPlane had functions “LowerLandingGear” and “MaxPassengers”.

Recently, I changed it so that there’s an IVehicle interface, which has no corresponding CVehicle class, and which both CCar and CPlane implement. So:

ICar has “StepOnGas”; IPlane has “LowerLandingGear”; IVehicle has “MaxPassengers”. CCar implements ICar and IVehicle; CPlane implements IPlane and IVehicle.

This is working fine, but it’s a bit of a pain from the DLL client’s perspective; they’ve got an ICar, and they want to know how many passengers it can hold. Previously, they could just ask it; now, they have to jump through the hoop of changing it into an IVehicle before they can ask it.

So what I’d like to do is more along the lines of this:

ICar has “StepOnGas” and “MaxPassengers”; IPlane has “LowerLandingGear” and “MaxPassengers”; IVehicle has “MaxPassengers”. CCar still implements both ICar and IVehicle, and CPlane still implements both IPlane and IVehicle.

I want there to be one and only one “MaxPassengers” for CCar, and it to be accessible both from ICar and from IVehicle; similarly, one and only one “MaxPassengers” for CPlane, and it accessible both from IPlane and IVehicle.

Would this cause any problems? Would I have to do anything specific other than just add “MaxPassengers” to the IDL for ICar and IPlane?

In case it matters, clients of this DLL are written in both VC++ 6.0 and VB6.

Thanks in advance for any help.

  • 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-12T22:22:01+00:00Added an answer on May 12, 2026 at 10:22 pm

    Simple answer: yes, you can

    Even better: why don’t you inherit ICar from IVehicle, that is you can extend IVehicle with new methods and name it ICar. This way your object can be QI’d for both interfaces and ICar will have all the methods a client needs to manipulate the object. This also allows ICar to be upcasted to IVehicle so both interface can share a single implementation (i.e. accessing MaxPassengers both on ICar and IVehicle executes the same C++ method).

    Same for IPlane but the extension will include different methods.

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

Sidebar

Related Questions

I have a COM outproc server written in ATL that registers itself using _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
I have created a COM dll using ATL. When I attempt to use it
I have a out of proc COM server (ATL based) and a Java app
I have a COM object written using the MS ATL library. I have declared
Hi I have a COM DLL implemented in ATL and now I want to
I have an ATL COM component method which takes a BSTR as an in
I have a ATL COM project that was compiling fine in VC6 which gives
We have an ATL Service written in Visual Studio 6 which is now requiring
I have an ATL COM object that I am using from C#. The interface
I've written an ATL/ActiveX object which exposes various properties and methods through its COM

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.