Crash when control is moved (original) (raw)

I use a dockpanel suite with the ScintillaNET control in it. Everything was fine until one of the recent versions, where now if you drag the form that the control is on an exception is thrown. I don't know which version of ScintillaNET caused it because I only just noticed it. The following error is displayed:

An unhandled exception of type 'System.AccessViolationException' occurred in ScintillaNET.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

for the method:

private static IntPtr DirectMessage(IntPtr sciPtr, int msg, IntPtr wParam, IntPtr lParam) { // Like Win32 SendMessage but directly to Scintilla var result = directFunction(sciPtr, msg, wParam, lParam); return result; }

EDIT: now for some reason even if I try using an older version it happens. Is there a fix for this? It is absolutely necessary that I be able to drag it around in my application. Thanks.