G
Guest
Hi,
Does anyone know how Control.Invoke can invoke a method which has ref
parameters?
For example,
class A {
public delegate MyFuncHandler(ref int i, ref int j);
public void MyFunc(ref int i, ref int j)
{
..
}
public A
public void MyCaller(DataGridView oDataGridView)
{
int x = 1;
int y = 1;
...
oDataGridView.Invoke(new MyHandler(MyFunc), new object { ref x, ref y });
....
}
oDataGridView.Invoke(new MyHandler(MyFunc), new object { ref x, ref y });
produces compilation error. Am I doing this wrong, or Control.Invoke does
not allow method with ref parameters?
Thanks,
Does anyone know how Control.Invoke can invoke a method which has ref
parameters?
For example,
class A {
public delegate MyFuncHandler(ref int i, ref int j);
public void MyFunc(ref int i, ref int j)
{
..
}
public A
public void MyCaller(DataGridView oDataGridView)
{
int x = 1;
int y = 1;
...
oDataGridView.Invoke(new MyHandler(MyFunc), new object { ref x, ref y });
....
}
oDataGridView.Invoke(new MyHandler(MyFunc), new object { ref x, ref y });
produces compilation error. Am I doing this wrong, or Control.Invoke does
not allow method with ref parameters?
Thanks,