Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

We have a system which uses C++ dll. This dll has some functions with pointer references in it. We do not want to make changes to the main system.

Can we just replace C++ dll with a C# dll if both provide the same functionality ?

Please advice.

Thanks

Pr.

What I have tried:

I have not tried this .This is the requirement.
Posted
Updated 17-Jun-16 10:25am

1 solution

This is not easy, but possible. The other way around wound be much easier. You have to export managed method as unmanaged. Many will tell you that this is impossible, but the CLR and IL standards formally allow such things, which is not directly supported by C# programming. Several CodeProject articles put forward the work around approach. For further detail, please see these answers:
loading C# DLL in MFC,
How can I use a dll created in Visual Basic 2008 in Visual Basic 6.0,
Call Managed DLL written in C# from Unmanged Code VC++,
API's in .Net: Managed or UnManaged Code.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900