ScintillaNET
ScintillaNET copied to clipboard
Failure to get address of "Scintilla_DirectFunction" when executing as x86
Hello,
If I configure the project to run in x86 mode then the component will fail to initialize because it cannot get the address of the "Scintilla_DirectFunction" procedure. The project was compiled with .Net Framework 4.5.2. Tried on Win7 x86 as well as Win10 x64.
Thank you, Bogdan
In x86 mode, the "Scintilla_DirectFunction" function name becomes "_Scintilla_DirectFunction @ 16", I don't know why. After line 3747 in "Scintilla.cs" source code
var directFunctionPointer = NativeMethods.GetProcAddress(new HandleRef(this, moduleHandle), "Scintilla_DirectFunction");
add a line code:
if (directFunctionPointer == IntPtr.Zero) directFunctionPointer = NativeMethods.GetProcAddress(new HandleRef(this, moduleHandle), "_Scintilla_DirectFunction@16");
This will work.
Thank you @imgits Yes, you are correct the x86 version of the embedded SciLexer in the latest release exposes "_Scintilla_DirectFunction@16" instead of "Scintilla_DirectFunction". I checked and it seems that the new version of SciLexer fixes this issue.
Thank you, Bogdan