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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:54:26+00:00 2026-05-16T03:54:26+00:00

I have created an interface which I am inheriting from another (COM) interface: public

  • 0

I have created an interface which I am inheriting from another (COM) interface:

public interface IDTSComponentMetaData : IDTSComponentMetaData90 { }

That’s all it does.

The reason behind this is, depending on which version of SQL Server I am working with, the base may be IDTSComponentMetaData90 (2005) or IDTSComponentMetaData100 (2008). Rather than conditionally compile every reference to IDTSComponentMetaData90 / IDTSComponentMetaData100 in code, I’d like to use the version-neutral interface which will simply wrap the proper real interface.

The problem is that SSIS passes me an object to the native interface at one key point, and I need to cast it to my wrapper interface:

#if SQL2005
public void Initialize(IDTSComponentMetaData90 c,IServiceProvider s) {
#elif SQL2008
public void Initialize(IDTSComopnentMetaData100 c,IServiceProvider s) {
#endif
  m_ComponentMetaData = (IDTSComponentMetaData) c;
  m_ServiceProvider = s;
}

This compiles with no problem, but at run time, I get an ‘Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘MyNameSpace.IDTSComponentMetaData’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{483E01E7-001C-35E4-Ac9f-4B0C1B81E409}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Is what I am doing totally wrong?

  • 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-16T03:54:26+00:00Added an answer on May 16, 2026 at 3:54 am

    Any reason you don’t simply alias the interface depending on SQL Server version?

    #if SQL2005
    using IDTSComponentMetaData = IDTSComponentMetaData90;
    #elif SQL2008
    using IDTSComponentMetaData = IDTSComopnentMetaData100;
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created 4 buttons via Interface Builder. I have an array which has
I created a UITableViewCell in Interface Builder which I have added a UIImageView and
I have created an interface with ServiceContract on interface and OperationContract on all its
I have created a UISegmentedControl with two segments using the interface builder (from storyboard),
I have created the simple web service. Code: [ServiceContract] public interface ITsdxService { [OperationContract]
I have a UIScrollView and a UIImageView which I have created programmatically without interface
I'm using Entity Framework and I have created an interface for lease transactions: public
I have created a console application in which I have exposed interface having [OperationContract(IsOneWay
I have a header-file, the COM interface. I have created a small win32 program
I have created a WCF service which does not use the app.config to configure

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.