Skip to content

Commit 2a0f0ff

Browse files
committed
Merge pull request #1059 from Neverbirth/development
Fixed Scintilla loading
2 parents 9617720 + 5d8c3b8 commit 2a0f0ff

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

PluginCore/ScintillaNet/ScintillaControl.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
using System;
2-
using System.IO;
3-
using System.Text;
4-
using System.Drawing;
52
using System.Collections;
6-
using System.Windows.Forms;
73
using System.Collections.Generic;
4+
using System.ComponentModel;
5+
using System.Drawing;
6+
using System.Drawing.Printing;
7+
using System.IO;
88
using System.Runtime.InteropServices;
9+
using System.Text;
10+
using System.Windows.Forms;
911
using ScintillaNet.Configuration;
10-
using System.Drawing.Printing;
1112
using PluginCore.FRService;
1213
using PluginCore.Utilities;
1314
using PluginCore.Managers;
@@ -231,9 +232,15 @@ public ScintillaControl(string fullpath)
231232
hwndScintilla = CreateWindowEx(0, "Scintilla", "", WS_CHILD_VISIBLE_TABSTOP, 0, 0, this.Width, this.Height, this.Handle, 0, new IntPtr(0), null);
232233
directPointer = (IntPtr)SlowPerform(2185, 0, 0);
233234
IntPtr sciFunctionPointer = GetProcAddress(new HandleRef(null, lib), "Scintilla_DirectFunction");
234-
/* if (sciFunctionPointer == IntPtr.Zero)
235-
throw new Win32Exception(Resources.Exception_CannotCreateDirectFunction, new Win32Exception(Marshal.GetLastWin32Error()));
236-
*/
235+
if (sciFunctionPointer == IntPtr.Zero)
236+
sciFunctionPointer = GetProcAddress(new HandleRef(null, lib), "_Scintilla_DirectFunction@16");
237+
238+
if (sciFunctionPointer == IntPtr.Zero)
239+
{
240+
string msg = "The Scintilla module has no export for the 'Scintilla_DirectFunction' procedure.";
241+
throw new Win32Exception(msg, new Win32Exception(Marshal.GetLastWin32Error()));
242+
}
243+
237244
_sciFunction = (Perform)Marshal.GetDelegateForFunctionPointer(
238245
sciFunctionPointer,
239246
typeof(Perform));

0 commit comments

Comments
 (0)