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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:58:33+00:00 2026-05-15T04:58:33+00:00

This question might seem a repeat of previous ones. I have read through a

  • 0

This question might seem a repeat of previous ones. I have read through a series of posts, but not completely clear for my situation.

I have a c++ library which is created using momentics IDE. I have to be able to use this library into a c# project.

Someone had been working on this project before being handed over to me. Currently, there are 2 layers for making this possible. First, a c++ project includes the complete library with a c++ wrapper. This project creates a dll as the output. This c++ dll is then fed to a c# project, which has dllimport calls to the c++ dll. This c# project again creates a dll. Finally, in order to use the library in c# application, I have to include a reference to both of these dlls.

Is this the correct way to get it working? I was thinking probably there should be a way to simplify the process.

Can someone please help me with this question?

  • 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-15T04:58:34+00:00Added an answer on May 15, 2026 at 4:58 am

    Given that you’re using a C++ library, I’m assuming it takes advantage of C++ semantics like classes, rather than just exposing procedures. If this is the case, then the way this is typically done is via a manually-created managed C++ interop library.

    Basically, you create a managed C++ library in Visual Studio, reference your existing C++ library, and create a managed wrapper around your existing C++ classes. You then reference this (managed) C++ assembly in your C# project and include the original (unmanaged) C++ library in your C# assembly just as a file that gets placed in the build directory.

    This is required because there is no way to reference things like C++ classes via P/Invoke (DllImport) calls.

    If your base library is just a series of functions, then you can reference that directly in the C# project via P/Invoke functions.

    Either way, all of the libraries mentioned above (for the first, the unmanaged C++ library, the managed C++ assembly, and the C# project, or, for the second, the unmanaced C++ library and the C# project) must be included in any project that references them. You cannot statically link the unmanaged library into the managed assembly.

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

Sidebar

Related Questions

This question might not seem programming related at first, but let me explain. I'm
Note: This might seem like a Super User question at first, but please read
This might seem like a stupid question I admit. But I'm in a small
Ok sorry this might seem like a dumb question but I cannot figure this
This question might be kind of elementary, but here goes: I have a SQL
This question might seem stupid but i nonetheless i believe it's a worth asking
This question might seem very specific but I am in need of some ideas
To a person skilled in programming, I know this question might seem ridiculous, but
This might seem like a strange question, but can I actually shut down the
This might seem like a duplicate question, but I can't find any information on

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.