I have a C++ class which does network communications, and wish to use it in a C# application. However I wish to be able to have delegates pointing to the functions so that they can be used as callbacks. Does this change anything about the way I need to export the C++ dll?
Asked
Active
Viewed 214 times
1
-
[this](http://stackoverflow.com/questions/4737018/how-to-call-net-c-code-from-a-native-c-dll) might help – user1227804 Feb 29 '12 at 09:50
-
Apologies if the question was not clear enough but what I want is for the C++ functions to be used as callbacks with delegates in the C# app, not the other way around. I don't know whether this requires any extra work when exporting the functions. – Bill Walton Feb 29 '12 at 12:09
1 Answers
0
This is how I would do it. Export the functions you need to call from the DLL as C functions and provide some delegates wrapper thing in your C# code.

Camford
- 770
- 3
- 5