Hi
I have a few DLLs which I'm referencing in two test applications, UEClientTest and UEServerTest. The references are UEGameClient.dll and UEGameServer.dll.
In UEClientTest and UEServerTest, there is the following method in class Main:
public void logPacket(PacketDirection direction, string name)
{
if (InvokeRequired)
{
Invoke(new logPacketDelegate(logPacket), direction, name);
}
else
{
listBox1.Items.Add((direction == PacketDirection.SEND ? "To" : "From") + " client: " + name);
}
}
private delegate void logPacketDelegate(PacketDirection direction, string name);
That method is called from UEGameClient.dll and UEGameServer.dll respectively, from another thread, hence the delegate and invocation.
The issue is that when I try to use this method, I get the error "Object does not match target type". Example usage:
main.GetType().GetMethod("logPacket").Invoke(main, PacketDirection.SEND, packet.GetType().Name);
Here, "main" is a Form parameter which is passed to this class upon construction.
What I have tried:
---------------------------------------------------------------------------