I
Ivonne Riedel
Working on an incremental drawing algorithm I am facing a problem PInvoking
ScrollWindowEx:
The code is as follows...
C#:
[DllImport("user32.dll")]
public static extern int ScrollWindowEx(IntPtr hWnd, int
dx, int dy, IntPtr scrollRect, IntPtr clipRect, IntPtr
hrgn, ref Rectangle updateRect, uint flags);
Rectangle update = new Rectangle();
ScrollWindowEx(
this.Handle,
this.ClientRectangle.X - hScrollBar.Value,
0,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
ref update,
0);
C++:
child->ScrollWindowEx(child->fenster_pos.x-pos,0,NULL,NULL,NULL,&update,0);
There is a difference in the values between calling ScrollWindowEx in C++
and through the PInvoke with C#.
The arguments are identical but not the results (update.left, scrolling only
horizontally).
Can anybody identify the problem or my mistake?
Thanks in advance.
Ivonne.
ScrollWindowEx:
The code is as follows...
C#:
[DllImport("user32.dll")]
public static extern int ScrollWindowEx(IntPtr hWnd, int
dx, int dy, IntPtr scrollRect, IntPtr clipRect, IntPtr
hrgn, ref Rectangle updateRect, uint flags);
Rectangle update = new Rectangle();
ScrollWindowEx(
this.Handle,
this.ClientRectangle.X - hScrollBar.Value,
0,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
ref update,
0);
C++:
child->ScrollWindowEx(child->fenster_pos.x-pos,0,NULL,NULL,NULL,&update,0);
There is a difference in the values between calling ScrollWindowEx in C++
and through the PInvoke with C#.
The arguments are identical but not the results (update.left, scrolling only
horizontally).
Can anybody identify the problem or my mistake?
Thanks in advance.
Ivonne.