Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Crash when control is moved #93

Closed
theryan722 opened this issue Jul 26, 2015 · 1 comment
Closed

Crash when control is moved #93

theryan722 opened this issue Jul 26, 2015 · 1 comment

Comments

@theryan722
Copy link
Contributor

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.

@Aghlara
Copy link

Aghlara commented Jul 27, 2015

I had the similar issue reported as well #85. To be more clear, this had two different issues one is crashing randomly on moving control.

jacobslusser added a commit that referenced this issue Oct 14, 2015
…st fix.

Added a new opt-in method SetDestroyHandleBehavior(true) to work around
issues with the control being sent WM_DESTROY messages when we don't
want them.
jacobslusser added a commit that referenced this issue Jul 24, 2016
The fix for #85, #93, #97 and #123 has been out and vetted by users for
quite a while now and so I'm making it the default behavior. Instead of
calling SetDestroyHandleBehavior(true) to enable it, it is now enabled
by default and can be disabled by calling
SetDestroyHandleBehavior(false).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants