I have a problem with a WPF application. When running it, it breaks with a System.Windows.Markup.XamlParseException giving:
Additional information: 'The invocation of the constructor on type 'myproject_csharp.MainWindow'
that matches the specified binding constraints threw an exception.' Line number '7' and line
position '9'.
At this position I am calling a function out of an external DLL which expects a variable arguments list:
int pos = 0;
res = myfunc_init(ref pos,__arglist(several parameters here));
This function itself is defined as
[DllImportAttribute("my.dll", EntryPoint = "myfunc_init_api", CharSet = CharSet.Ansi, CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
public static extern uint myfunc_init(ref int var, __arglist);
From what I can see, everything is correct. So where could this exception come from? Any issues with the variable arguments list?
One thing to note: in the IDE the function is marked as erroneous with "No overload for method takes 2 arguments" but then int compiles without errors.
Thanks!