I have found several posts about delegates with variable number of parameters but I'm too thick to understand what they mean and how they apply to my situation.
This is what I have in the main form:
public delegate void Report( params Object[] args );
...
public partial class Main : Form
{
public ReportDelegate m_dlgtReport;
...
public Main()
{
InitializeComponent();
m_dlgtReport = new ReportDelegate( this.Report );
...
}
private void Report( params Object[] args )
{
if( args.Length > 0 )
{
string s1 = (string)args[ 0 ];
}
...
}
This is how I call this from a thread:
m_Main.Invoke(
m_Main.m_dlgtReport,
new Object[] {
"text",
101,
true
} );
m_Main.Invoke(
m_Main.m_dlgtReport,
new Object[] {
"text"
} );
The compiler goes for it but the application crashes.
Anyone out there could either speak really, really slow to me or simply fix the code above and I'll study it?
Thank you all, kind people.