
alsing - issue #2
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
What steps will reproduce the problem? 1. Launched MDIDemo 2. Opened a .syn file 3. Pressed button for SettingsForm
What is the expected output? What do you see instead? Expected to see the settings form...instead got: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
What version of the product are you using? On what operating system? Latest source from Google site...on Windows XP with VStudio 2008
Please provide any additional information below. I was able to download and run the sample project and all the other functions worked flawlessly...I started trying to debug, but I cannot see any reason for this to throw and exception...
Comment #1
Posted on Feb 16, 2009 by Helpful KangarooOk, i write in VB, but I noticed that in C# it doed not give a very good error... just Attempted to read or write protected memory
so i recreated it in VB, and got the same error but more information, the list box contains to many items?!?!?!? well after a little playing and testing...
in Style.cs comment out the overrides ToSting add property StyleName and just do a get name NO SET for this
on the SettingsForm.cs in SettingsForm function (the NEW function for VB) where you see the lbStyles.selectedindex = 0 right above that add lbStyles.DisplayMember = "StyleName";
problem solved
Comment #2
Posted on Dec 19, 2009 by Happy CamelHi.
Found this one out and it appears that tha problem happens in some files rather than others, due to many styles with null names.
To solve this, instead of commenting out the ToString() override, you can just add something like
if (string.IsNullOrEmpty(s.Name))
s.Name = "Style " + i;
in the constructor of SettingsForm, so that it will give unique names to the unnamed styles.
And trsprayp, cheers for finding out about the listbox! I was bangging my head around this one, and if it were not for you, I'd still be.
Status: New
Labels:
Type-Defect
Priority-Medium