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

Use IntPtr for TextRange to support x86 and x64 #91

Merged
merged 1 commit into from
May 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ public int Value
[StructLayout(LayoutKind.Sequential)]
public struct CharacterRange
{
public CharacterRange(int cpmin, int cpmax) { cpMin = cpmin; cpMax = cpmax; }
public int cpMin;
public int cpMax;
public CharacterRange(int cpmin, int cpmax) { cpMin = new IntPtr(cpmin); cpMax = new IntPtr(cpmax); }
public IntPtr cpMin;
public IntPtr cpMax;
}

public class Cells
Expand All @@ -217,8 +217,8 @@ public TextRange(CharacterRange chrRange, int stringCapacity)
}
public TextRange(int cpmin, int cpmax, int stringCapacity)
{
_sciTextRange.chrg.cpMin = cpmin;
_sciTextRange.chrg.cpMax = cpmax;
_sciTextRange.chrg.cpMin = new IntPtr(cpmin);
_sciTextRange.chrg.cpMax = new IntPtr(cpmax);
_sciTextRange.lpstrText = Marshal.AllocHGlobal(stringCapacity);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3232,8 +3232,8 @@ public TextToFind(CharacterRange chrRange, string searchText)
/// <param name="searchText">the search pattern</param>
public TextToFind(int cpmin, int cpmax, string searchText)
{
_sciTextToFind.chrg.cpMin = cpmin;
_sciTextToFind.chrg.cpMax = cpmax;
_sciTextToFind.chrg.cpMin = new IntPtr(cpmin);
_sciTextToFind.chrg.cpMax = new IntPtr(cpmax);
_sciTextToFind.lpstrText = Marshal.StringToHGlobalAnsi(searchText);
}

Expand Down