Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 7caa5b8

Browse files
authored
Merge pull request #91 from Fruchtzwerg94/use_intptr_for_text_range
Use IntPtr for TextRange to support x86 and x64
2 parents 3292e9f + db7aa9e commit 7caa5b8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Visual Studio Project Template C#/PluginInfrastructure/GatewayDomain.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ public int Value
188188
[StructLayout(LayoutKind.Sequential)]
189189
public struct CharacterRange
190190
{
191-
public CharacterRange(int cpmin, int cpmax) { cpMin = cpmin; cpMax = cpmax; }
192-
public int cpMin;
193-
public int cpMax;
191+
public CharacterRange(int cpmin, int cpmax) { cpMin = new IntPtr(cpmin); cpMax = new IntPtr(cpmax); }
192+
public IntPtr cpMin;
193+
public IntPtr cpMax;
194194
}
195195

196196
public class Cells
@@ -217,8 +217,8 @@ public TextRange(CharacterRange chrRange, int stringCapacity)
217217
}
218218
public TextRange(int cpmin, int cpmax, int stringCapacity)
219219
{
220-
_sciTextRange.chrg.cpMin = cpmin;
221-
_sciTextRange.chrg.cpMax = cpmax;
220+
_sciTextRange.chrg.cpMin = new IntPtr(cpmin);
221+
_sciTextRange.chrg.cpMax = new IntPtr(cpmax);
222222
_sciTextRange.lpstrText = Marshal.AllocHGlobal(stringCapacity);
223223
}
224224

Visual Studio Project Template C#/PluginInfrastructure/Scintilla_iface.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,8 +3232,8 @@ public TextToFind(CharacterRange chrRange, string searchText)
32323232
/// <param name="searchText">the search pattern</param>
32333233
public TextToFind(int cpmin, int cpmax, string searchText)
32343234
{
3235-
_sciTextToFind.chrg.cpMin = cpmin;
3236-
_sciTextToFind.chrg.cpMax = cpmax;
3235+
_sciTextToFind.chrg.cpMin = new IntPtr(cpmin);
3236+
_sciTextToFind.chrg.cpMax = new IntPtr(cpmax);
32373237
_sciTextToFind.lpstrText = Marshal.StringToHGlobalAnsi(searchText);
32383238
}
32393239

0 commit comments

Comments
 (0)