c# AddSignalHandler

Armin Erkert armin.erkert at rolmail.net
Thu Feb 23 08:09:34 UTC 2023


Hi,

when I try to add a SignalHandler


public delegate void MyDelegateNewFormat(object sender, GLib.SignalArg args);

....

splitElement.AddSignalHandler("format-location", new  
MyDelegateNewFormat(NewFormat));

.....

static void NewFormat(object sender, GLib.SignalArgs args)
{
}


I get this Error:

System.ArgumentException: Object of type 'System.EventArgs' cannot be  
converted to type 'GLib.SignalArgs'.
    at System.RuntimeType.TryChangeType(Object value, Binder binder,  
CultureInfo culture, Boolean needsSpecialCast)
    at System.RuntimeType.CheckValue(Object value, Binder binder,  
CultureInfo culture, BindingFlags invokeAttr)
    at System.Reflection.MethodBase.CheckArguments(Object[]  
parameters, Binder binder, BindingFlags invokeAttr, CultureInfo  
culture, Signature sig)
    at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object  
obj, BindingFlags invokeAttr, Binder binder, Object[] parameters,  
CultureInfo culture)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,  
BindingFlags invokeAttr, Binder binder, Object[] parameters,  
CultureInfo culture)
    at System.Delegate.DynamicInvokeImpl(Object[] args)
    at System.Delegate.DynamicInvoke(Object[] args)
    at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
    at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
    at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr  
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr  
invocation_hint, IntPtr marshal_data)
PushData
    at GLib.ExceptionManager.RaiseUnhandledException(Exception e,  
Boolean is_terminal)
    at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr  
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr  
invocation_hint, IntPtr marshal_data)


Can anyone help ne ?

Regards Armin


--------------------------------
Ing. Erkert Armin
Mittelstrich 9
I-39050 Tiers (BZ)

Email: armin.erkert at rolmail.net
Tel.:  +39 349 4385335
WWW:   www.erkert.it



More information about the gstreamer-devel mailing list