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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:16:09+00:00 2026-05-16T11:16:09+00:00

I am trying to translate the COM Interop instructions given by my camera manufacturer

  • 0

I am trying to translate the COM Interop instructions given by my camera manufacturer for C++ to C#.

They write:

To obtain the interface, you use the normal COM functions to ask for the specific interface you need from the capture filter.
For example:

IBaseFilter* pSourceFilter;
...
CComQIPtr<IManufacturersInterface> pKs( pSourceFilter );
pKs->SetShutterSpeed( ssAuto1 );

They also give an interface signature and a Guid. The signature looks like

interface IManufacturersInterface: IUnknown
{
    // more stuff
    HRESULT SetShutterSpeed( [in] eShutterSpeed lShutter );
    // more stuff
}

which I translated into C# as

[ComImport]
[Guid("926ddb16-3c8e-476c-9068-eb4555a99231")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IManufacturersInterface
{
    // more stuff
    [PreserveSig]
    int SetShutterSpeed([In] eShutterSpeed lShutter);
    // more stuff
}

From another source I got a similar DirectShow wrapper to access the camera in the first place, including an COM-imported interface IBaseFilter. How would I now translate the first example?

I tried

IManufacturersInterface control = sourceFilter as IManufacturersInterface; // sourceFilter is declared as IBaseFilter
control.SetShutterSpeed(eShutterSpeed.ssAuto1);

but control is null after the cast.

Sorry if I am vague, I have no real clue what I am doing here. This is the first time I had to use COM Interop. It shows, hm? =)

  • 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-16T11:16:10+00:00Added an answer on May 16, 2026 at 11:16 am

    The easiest way to do com interop is to let Visual Studio create the interop for you – I used it with many different com objects and never had any issues with it. To get started, in your C# project select Add Reference and select the tab COM, find the camera manufacturer’s object in the list and you should be done. You can now use the com objects as if they were native C#.

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

Sidebar

Related Questions

I'm trying to use the google translate api's to... well translate some text, but
I'm trying to parse the following URI : http://translate.google.com/#zh-CN|en|你 but got this error message
Im trying to use a function from Windows API on delphi, functions for Windows
I am trying to use Google Translate REST API and while requesting the following
I'm trying to write a POST call to Google Translate with Jersey 1.5. This
I am trying to go through the mess of COM interop definitions we have
I'm trying to translate the following slugify method from PHP to C#: http://snipplr.com/view/22741/slugify-a-string-in-php/ Edit:
I am trying to use the Google Translate v2 api in my app engine
I'm trying to use the new version of the Google Translate API (V2) via
Hi I am trying to use the custom Binary Integer division method: Source: http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=642

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.