© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
7 replies
hugeman

Best practices when using C++ DLL Project interop with C#?

I've implemented some of my project in C++ and I call that code from C#. My current way of loading the DLL is to call the LoadLibrary (and then use GetProcAddress + the Delegate helper method to invoke methods safely from C#). But I have to hard code the DLL's path, allowing it to either exist in the bin folder, or backing out of that folder to the solution folder and into x64, etc., to the built DLL file.

How else can I load the DLL?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ C# best practices clarification
C#CC# / help
3y ago
❔ Need help with C#/C++ interop
C#CC# / help
3y ago
✅ Using a C# DLL in C++
C#CC# / help
2y ago
Using a c++ dll in c#
C#CC# / help
2y ago