Hi Max,
I am not if I am missing something from your code snippet that could cause
the error, but I seem to be able to compile the same code correctly - The
compiler does not seem to complain if I use the below code snippets that you
posted.
public class Entity : System.Windows.Forms.Label
{
protected System.Drawing.Point lastMousePosition;
}
public class Flow : Entity
{
protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
{
int deltaX = MousePosition.X - lastMousePosition.X;
int deltaY = MousePosition.Y - lastMousePosition.Y;
}
}
Let me know and we can look into the issue a little more.
Regards,
Aravind C
"Max" <Pl****@reply.to.news.group> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
public class Entity : System.Windows.Forms.Label
{
...
protected System.Drawing.Point lastMousePosition;
...
}
public class Flow : Entity
{
...
protected override void OnMouseMove(
System.Windows.Forms.MouseEventArgs e )
{
int deltaX = MousePosition.X - lastMousePosition.X;
int deltaY = MousePosition.Y - lastMousePosition.Y;
...
}
...
}
This code causes an error:
Cannot pass ...lastMousePosition as ref or out, because
....lastMousePosition is a marshal-by-reference class
What does it mean? What is wrong with the code?