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

  • Home
  • SEARCH
  • 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 5933517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:59:03+00:00 2026-05-22T14:59:03+00:00

Ok, I am calling an interop dll which I have no access to. Here

  • 0

Ok, I am calling an interop dll which I have no access to. Here is the pseudo code:

dynamic myVariable = null;

firstInteropMethod(ref myVariable);
secondInteropMethod(myVariable); //Not by ref

The method signatures for the two methods are

firstInteropMethod(ref object someObject);
secondInteropMethod(object someObject);

The expected value is a double array of the definition

double[,]

Now the fun part. My original code gets the wrong results but no error. However, this code:

firstInteropMethod(ref myVariable);
secondInteropMethod((double[,]) myVariable);

Gives the expected results.

Using watches and type of statements I have determined that nothing changes between the two calls so what gives? Why would there be a difference and what would that difference be?

  • 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-22T14:59:04+00:00Added an answer on May 22, 2026 at 2:59 pm

    This MSDN article on dynamic explains why casting is needed for COM Interop when operations declare the parameter type as object and indicates that using the /link:filelist compiler option will allow you to define the COM method signatures as dynamic as well.

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

Sidebar

Related Questions

I have the following code in Perl which posts to my HTTP Servlet, calling
When you interface a COM object from .NET code, VS creates an interop DLL,
I have this DataLink DLL on my system - Interop.MSDASC.dll I am trying to
I have the following code in project1 that is calling a class from project2.
I'm trying to use the EntLib 3.1 within .net code for a dll which
I have a .net application that is doing COM interop and calling some native
i'm calling a C# com interop dll from classic asp. i want to send
I have an Access VBA project from where I refer to a COM Interop
Here's the current code I have got private void recalculateRRange(Excel.Range UsedRange) { Excel.Range currentRRange
Calling getActionBar returns null . This has been frequently reported so I've made sure

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.