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

The Archive Base Latest Questions

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

I apologize if this is a duplicate. I am writing a class that needs

  • 0

I apologize if this is a duplicate. I am writing a class that needs to interact with an old c++ unmanaged dll. There is one method that I am having a hard time mapping to managed code:

long DoSomething(int id, double* points, long numberOfPoints, bool useShaping)

I have been thus far unable to map that to an extern method that does not throw a stack unbalanced exception. The problem is with the double pointer. What would the method signature look for in managed code? Here’s what I’ve tried that does not work as an example.

[DllImport("Something.Dll", EntryPoint = "DoSomething")]
public static extern long DoSomething(int id, double[] points, long numberOfPoints, bool useShaping)
  • 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-06T07:04:25+00:00Added an answer on June 6, 2026 at 7:04 am

    There are likely two problems –

    1. This most likely needs to specify the calling convention.
    2. “long” in C++ maps to “int” in C#

    Try the following:

    [DllImport("Something.Dll", EntryPoint = "DoSomething", CallingConvention=CallingConvention.Cdecl)]
    public static extern int DoSomething(int id, double[] points, int numberOfPoints, bool useShaping);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologize if this is a duplicate but I couldn't find any solutions that
I apologize if this a duplicate question (I didn't find anything like that). I'm
I apologize if this is a duplicate but I did not find anything that
I apologize if this is a duplicate question, I searched a bit and couldn't
I apologize for this seemingly relatively simple task that I can't figure out. I
I apologize if this is a duplicate post, but I couldn't find the answer
Possible Duplicate: Where is EntityConfiguration in EF4 VS 2010 RTM? I apologize if this
I would like to apologize if the duplicate of this question exist. i tried
I apologize is this is a duplicate and I just could not phrase the
I must apologize if this is a duplicate question, but I can't seem to

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.