I'm writing a C# .NET DLL for a Clarion (Clarion is C++ like programming language) program.
I call into the C# .NET DLL just fine, all is working great. However, I need that C# .NET DLL to receive a Clarion Procedure for callback purposes and then be able to call that procedure passing three int parameters.
The Clarion Procedure looks like this (a Clarion long is a C# int):
MyCallBack procedure(long p1, long p2, long p3)
... Data ...
code
... Code ...
How do I pass the abvoe procedure to the C# .NET DLL and how does the C# .NET DLL call that procedure passing three int parameters?
Thanks in advance.
Hopefully this example gives you somewhere to start, it is based on an example from the SoftVelocity newsgroups (cached plain text version here).
Note: I am using the RGiesecke DllExport package and a modified version of the Clarion LibMaker to create a compatible lib file. You mentioned that you are already calling into the C# DLL without issue so I am assuming that you are doing something similar. If you are interested, I go into this further on my blog.
Clarion Code
C# Code