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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:46:04+00:00 2026-06-06T11:46:04+00:00

I have a third party DLL i need to call from my C# program.

  • 0

I have a third party DLL i need to call from my C# program.

I have added the dll to the references in my project and VS2010 has generated an COM – interop wrapper dll. The interfaces and classes defined in the DLL are now available in my program and working as they should.

Now the problem are the methods which returns a “dictionary” consisting of a key value pair of an integer and a TSEnt object. In the DLL the return type are defined as VARIANT* and in the wrapper as “object”.
The DLL dosn’t include any dictionary interface.

The only interface i have found in C#, that I can successfully cast this returnvalue to is a IEnumerable. But fetching values from the returnvalue using a foreach statement only returns a int32, which is the key-part of the underlying key/value pair.

How do i get the value-part of this dictionary ?

I have tried to cast this to IDictionary, IDictionary< int, object >, Hashtable and many more but all with the same result … cast error.
I guess the DLL is originally written in an early version of Visual Basic.

Please help … The problem has haunted me for the last 2 weeks …

Regards
Jesper Sandgaard

From the documentation:

Query(String ObjectType, String PropName, String Pattern)
Queries the repository for Objects of type ObjectType with the property PropName 
that have the value Pattern. Returns a Dictionary object containing a list of TSEnt
objects that the repository returns. This list is keyed by the index of the elements
in the list starting from 0. Pattern can contain ‘*’ as wildcard. If the Property
name is a Domained value, use the Display Value in the repository model.

From the DLL (ITypeLib Viewer):

[id(0x00000006), helpstring("method Query")]
HRESULT Query(
[in] BSTR Type,
[in] BSTR PropertyName,
[in] BSTR Pattern,
[out, retval] VARIANT* result);

Definition in VS:

[DispId(6)]
object Query(string Type, string PropertyName, string Pattern);
  • 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-06-06T11:46:06+00:00Added an answer on June 6, 2026 at 11:46 am

    If memory serves me right it is Dictionary object from an old COM runtime scripting library: SCRRUN.dll Import COM-TLB into your project and
    cast a variant that you are getting to that type.

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

Sidebar

Related Questions

I have a .nuspec file for my project, which references a third-party DLL that
I need to use a third party DLL which I don't have header ,
I have a third party dll that I need to install to the GAC.
I have to use third party, unmanaged COM dll into my .NET application. I
I have a third party application that allows you to call C functions from
I have a class in third party DLL. Class A { } I need
I have a third-party (Win32) DLL, written in C, that exposes the following interface:
I have a third party libs. (msvc10) a MT/MD (Static cfgs's) and dynamic DLL
I have to maintain an old VB 6 ActiveX DLL called by another third-party
I have a third party SDK in C# which has class names like this:

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.