Hi,
Does anyone know how Control.Invoke can invoke a method which has ref
parameters?
For example,
class A {
public delegate MyFuncHandler(r ef int i, ref int j);
public void MyFunc(ref int i, ref int j)
{
..
}
public A
public void MyCaller(DataGr idView oDataGridView)
{
int x = 1;
int y = 1;
...
oDataGridView.I nvoke(new MyHandler(MyFun c), new object { ref x, ref y });
....
}
oDataGridView.I nvoke(new MyHandler(MyFun c), 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,
--
George
Does anyone know how Control.Invoke can invoke a method which has ref
parameters?
For example,
class A {
public delegate MyFuncHandler(r ef int i, ref int j);
public void MyFunc(ref int i, ref int j)
{
..
}
public A
public void MyCaller(DataGr idView oDataGridView)
{
int x = 1;
int y = 1;
...
oDataGridView.I nvoke(new MyHandler(MyFun c), new object { ref x, ref y });
....
}
oDataGridView.I nvoke(new MyHandler(MyFun c), 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,
--
George
Comment