I have an event like static private void HandleClientEventCB(SPD.SPD_eventType type, SPD.SPD_event this_event, object passback) in a class public class SPURTServer, I need to call this event outside another event
Here the ‘**SPD_eventType**‘ is enumeration under different project that means ‘namespace Spo.SPDlib‘ and ‘public class SPD‘ here the value for that enum is SPD_clientEvent = 5,
and SPD.SPD_event is a struct like public struct SPD_event and passback value is null.
So I called like this in outside event like shown below
SPURTServer.HandleClientEventCB(Spo.SPDlib.SPD.SPD_eventType.SPD_clientEvent, Spo.SPDlib.SPD.SPD_event,object passback);
but it is throwing error like “Invalid expression term ‘object'” I am not sure what about the other two arguements. Can anybody guide me here?
In your call, you need to remove the word Object.
so:
or cast it:
Assuming that passback is a valid object in the scope of the call.
Edit: based on the comments below:
What you’re doing is passing the type of the event, not an instance of the event itself.
SPD_Event is a definition of your data, but you have created an instance of it.
You’d need to to something like