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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:51:28+00:00 2026-05-31T18:51:28+00:00

I have a native C++ DLL, and I want to import a C# DLL

  • 0

I have a native C++ DLL, and I want to import a C# DLL and use some of its functions (for example connecting to a database).

Now I have read that you can turn the DLL into a TLB COM file, and I have done that no problems. My problem lies with the C++. To call that TLB file I need to set CLR support. I use themida to help secure all my DLL’s as well as PEC. They do not support .net DLL’s and when I enable CLR the programs recognize it as a .net DLL.

Is there anyway to call a c# function inside a .net DLL from inside a native C++ DLL without enabling CLR?

  • 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-31T18:51:29+00:00Added an answer on May 31, 2026 at 6:51 pm

    The best way in my opinion is to crate a C++/CLI lib that you can use to communicate between the layers.

    This 3rd party library will be compiled with /clr enabled.

    Then you can use the header definitions to the proper c++ function wrappers to call the C# functions.

    C++/CLI can help you manage the call just the way you want it, and let you design the type casts the way you want them.

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

Sidebar

Related Questions

I have a method in my native dll, that I want to use. The
Quick question. I have an app that use a native DLL through PInvoke, this
I have a native c++ app, and I want to use some managed types
I don't want to use WebKit .NET because it doesn't have some functionality that
I have a managed DLL that I want to use in a legacy application
I have a dll that I want to read from a manually specified app.config
I have Java application which sends pointer to function (callback) to some native dll
I have a 32-bit .net application that uses a native 32-bit DLL via DllImport().
I have a native C Dll that calls 'LoadLibrary' to load another Dll that
I have a dll, which I want to use in my java code. I

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.