I have a code generator that is generating C# functions called by an external DLL (when certain messages from the network are received).
My problem is that my main software is running in VB.NET, so I search a way to pass the function call from C# to VB.NET but without changing the C# code (or only a way a code generator could do it).
Does anyone has an idea?
This would be C# code:
namespace Csharp
{
public class Test
{
System.Timers.Timer aTimer = new System.Timers.Timer();
public Test()
{
aTimer.Elapsed += new System.Timers.ElapsedEventHandler(EventGeneratedInCsharp);
aTimer.Interval = 5000;
aTimer.Enabled = true;
}
public void EventGeneratedInCsharp(object source, System.Timers.ElapsedEventArgs e)
{
}
}
}
I now need to forward the call to EventGeneratedInCsharp to my VB code. There is a reference from VB.NET to the C# DLL, but changing the C# code is not allowed (or only a way it can be automated). The C# code will also get results back he has to forward to the calling DLL again.
Any ideas? Delegate / Invoke / ... ???
Thanks - Martin.