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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:39:26+00:00 2026-05-28T23:39:26+00:00

I created a wrapper for 2 COM DLLs using TlbImp.exe . One has a

  • 0

I created a wrapper for 2 COM DLLs using TlbImp.exe.
One has a class that the wrapper describes as

using System;
using System.Runtime.InteropServices;

namespace GNOTDRSIGNATURESERVERLib
{
    [CoClass(typeof(GNOTDRSignatureServerClass)),
        Guid("20CBF9E0-06BF-11D3-97B5-0080C878CFFA")]
    public interface GNOTDRSignatureServer
    {
    }
}

This object must be passed as a parameter

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace GN8000Lib
{
    [TypeLibType(2),
         ClassInterface(0), 
         ComSourceInterfaces("GN8000Lib._I8000Events\0"),
         Guid("DCAD84FE-43A8-11D3-B1A2-005004131886")]
    public class GN8000Class : I8000
    {
        [MethodImpl(MethodImplOptions.InternalCall)]
        public extern GN8000Class();

        [DispId(6)]
        [MethodImpl(MethodImplOptions.InternalCall)]
        void I8000.Initialize(
            [IUnknownConstant] [MarshalAs(UnmanagedType.IUnknown)] [In]
            object pSigServer = null);
    }
}

Then I call the method like this:

var gn8000 = new GN8000();
var signatureServer = new GNOTDRSignatureServer();
gn8000.Initialize(signatureServer);

I think that the object that is being passed isn’t the right one. I feel like TlbImp.exe could link those DLLs and use GNOTDRSignatureServer instead of UnmanagedType.IUnknown, or that I could use System.Runtime.InteropServices.Marshal.GetComInterfaceForObject

What is wrong with my code?

  • 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-28T23:39:27+00:00Added an answer on May 28, 2026 at 11:39 pm

    The declarations look pretty ugly, I’ll assume they were generated by some kind of reverse-engineering tool and you didn’t write them yourself. In which case having an empty interface isn’t that unusual. The equivalent in COM is a dispinterface, an interface that only supports late binding through IDispatch. This is fairly common, the COM server might have been designed to work with scripting languages, runtime environments that only support late binding. Same thing as ComInterfaceType.InterfaceIsIDispatch in .NET. The [DispId] is important for late binding, call by number instead of name.

    Which then also makes the argument type easy to explain. Scripting languages use VARIANT as their variable type. Pretty similar to a variable you’d declare as object in C# code, it can store any value. Feature, not a bug.

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

Sidebar

Related Questions

I have installed SQLite and am using the wrapper from: http://sqlite.phxsoftware.com/ I have created
I recently created a generic Matrix<T> class that acts as a wrapper around a
I have a wrapper managed application(.net) over a COM Component(created using vb6) where Com
I am using Task Scheduler Managed Wrapper(http://taskscheduler.codeplex.com/). I've created a code which works perfectly
I am using SQLite wrapper provided by http://sqlite.phxsoftware.com in VS2010 Here is the code
I'm using a COM object from a third party library that generates periodic events.
I'm trying to fix problem with COM object that has been separated from its
We have an EPOS system that is built in VB6. A client is using
I've created a wrapper function for jQuery's $.ajax() method so I can pass different
I created a program using dev-cpp and wxwidgets which solves a puzzle. The user

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.