Skip to content

Commit 60e6451

Browse files
committed
First 64 bit support commit. Many errors yet.
1 parent 0107acf commit 60e6451

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

FlashDevelop/Bin/Debug/Aga.dll

0 Bytes
Binary file not shown.

FlashDevelop/Bin/Debug/SciLexer64.dll

904 KB
Binary file not shown.

FlashDevelop/Bin/Debug/SwfOp.dll

12 KB
Binary file not shown.

FlashDevelop/Utilities/PluginServices.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ public static void DisposePlugins()
9494
/// </summary>
9595
private static void AddPlugin(String fileName)
9696
{
97-
Assembly pluginAssembly = Assembly.LoadFrom(fileName);
9897
try
9998
{
99+
Assembly pluginAssembly = Assembly.LoadFrom(fileName);
100100
foreach (Type pluginType in pluginAssembly.GetTypes())
101101
{
102102
if (pluginType.IsPublic && !pluginType.IsAbstract)

PluginCore/ScintillaNet/ScintillaControl.cs

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ public class ScintillaControl : Control
2121
{
2222
private bool saveBOM;
2323
private Encoding encoding;
24-
private int directPointer;
25-
private IntPtr hwndScintilla;
24+
private IntPtr directPointer;
25+
private Perform _sciFunction;
26+
private IntPtr hwndScintilla;
2627
private bool hasHighlights = false;
2728
private bool ignoreAllKeys = false;
2829
private bool isBraceMatching = true;
@@ -42,7 +43,8 @@ public class ScintillaControl : Control
4243

4344
#region Scintilla Main
4445

45-
public ScintillaControl() : this("SciLexer.dll")
46+
public ScintillaControl()
47+
: this(IntPtr.Size == 4 ? "SciLexer.dll" : "SciLexer64.dll")
4648
{
4749
if (Win32.ShouldUseWin32()) DragAcceptFiles(this.Handle, 1);
4850
}
@@ -55,7 +57,15 @@ public ScintillaControl(string fullpath)
5557
{
5658
IntPtr lib = LoadLibrary(fullpath);
5759
hwndScintilla = CreateWindowEx(0, "Scintilla", "", WS_CHILD_VISIBLE_TABSTOP, 0, 0, this.Width, this.Height, this.Handle, 0, new IntPtr(0), null);
58-
directPointer = (int)SlowPerform(2185, 0, 0);
60+
directPointer = (IntPtr)SlowPerform(2185, 0, 0);
61+
IntPtr sciFunctionPointer = GetProcAddress(new HandleRef(null, lib), "Scintilla_DirectFunction");
62+
/* if (sciFunctionPointer == IntPtr.Zero)
63+
throw new Win32Exception(Resources.Exception_CannotCreateDirectFunction, new Win32Exception(Marshal.GetLastWin32Error()));
64+
*/
65+
_sciFunction = (Perform)Marshal.GetDelegateForFunctionPointer(
66+
sciFunctionPointer,
67+
typeof(Perform));
68+
5969
directPointer = DirectPointer;
6070
}
6171
UpdateUI += new UpdateUIHandler(OnUpdateUI);
@@ -1549,11 +1559,11 @@ public int DirectFunction
15491559
/// Retrieve a pointer value to use as the first argument when calling
15501560
/// the function returned by GetDirectFunction.
15511561
/// </summary>
1552-
public int DirectPointer
1562+
public IntPtr DirectPointer
15531563
{
15541564
get
15551565
{
1556-
return (int)SPerform(2185, 0, 0);
1566+
return (IntPtr)SPerform(2185, 0, 0);
15571567
}
15581568
}
15591569

@@ -5034,6 +5044,9 @@ public ShortcutOverride(Keys keys, Action<ScintillaControl> action)
50345044
[DllImport("user32.dll")]
50355045
public static extern IntPtr CreateWindowEx(uint dwExStyle, string lpClassName, string lpWindowName, uint dwStyle, int x, int y, int width, int height, IntPtr hWndParent, int hMenu, IntPtr hInstance, string lpParam);
50365046

5047+
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
5048+
public static extern IntPtr GetProcAddress(HandleRef hModule, string lpProcName);
5049+
50375050
[DllImport("user32.dll")]
50385051
public static extern IntPtr SetFocus(IntPtr hwnd);
50395052

@@ -5055,20 +5068,23 @@ public ShortcutOverride(Keys keys, Action<ScintillaControl> action)
50555068
[DllImport("shell32.dll")]
50565069
public static extern void DragAcceptFiles(IntPtr hwnd, int accept);
50575070

5058-
[DllImport("scilexer.dll", EntryPoint = "Scintilla_DirectFunction")]
5059-
public static extern int Perform(int directPointer, UInt32 message, UInt32 wParam, UInt32 lParam);
5071+
public delegate IntPtr Perform(
5072+
IntPtr sci,
5073+
int iMessage,
5074+
IntPtr wParam,
5075+
IntPtr lParam);
50605076

50615077
public UInt32 SlowPerform(UInt32 message, UInt32 wParam, UInt32 lParam)
50625078
{
50635079
return (UInt32)SendMessage((int)hwndScintilla, message, (int)wParam, (int)lParam);
50645080
}
5065-
public UInt32 SPerform(UInt32 message, UInt32 wParam, UInt32 lParam)
5081+
public UInt32 SPerform(int message, UInt32 wParam, UInt32 lParam)
50665082
{
5067-
if (Win32.ShouldUseWin32()) return (UInt32)Perform(directPointer, message, wParam, lParam);
5083+
if (Win32.ShouldUseWin32()) return (UInt32)_sciFunction(directPointer, message, (IntPtr)wParam, (IntPtr)lParam);
50685084
else return (UInt32)Encoding.ASCII.CodePage;
50695085
}
50705086

5071-
public override bool PreProcessMessage(ref Message m)
5087+
public override bool PreProcessMessage(ref Message m)
50725088
{
50735089
switch (m.Msg)
50745090
{

0 commit comments

Comments
 (0)