jacobslusser / ScintillaNET

A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
MIT License
963 stars 243 forks source link

64 bit 'Lines' count problem #488

Open p4spares opened 4 years ago

p4spares commented 4 years ago

hi, i'm trying to use ScintillaNet on a 64 bit application, this way:

        scintilla = new ScintillaNET.Scintilla();
        scintilla.Dock = DockStyle.Fill;
        panel1.Controls.Add(scintilla);

        scintilla.Text = "aaaa\nbbbbb\n";

        int n = scintilla.Lines.Count;

on 64 bit i get 1 as result of the Lines.Count, wrong. on 32 bit, i get 3, correct.

i did some debugging and i found out the events in scintilla_SCNotification are not the same in 32/64bit.

thanks, Davide

VPKSoft commented 4 years ago

Perhaps there is some kind of a layout thing happening, since you are doing all at once. I tried with 32, 64 and Any CPU with prefer 32-bit on/off and the result was always correct but the line count is taken in a button click event: image

p4spares commented 4 years ago

hi, here is my settings for compile scintillanet: image and for my demo application: image both are forced to 64 bit for avoid different behaviours. as i remember i also changed target framework to 4.8 as required by the application im working on. over weekend i plan to retry from scratch. David

i100yanov commented 1 year ago

I had the same problem. It appeared to be due to type changes in the SCNotification struct. Implementing Update types in the SCNotification struct #447, solved the Lines.Count problem in 64-bit builds.