vijirams / alsing

Automatically exported from code.google.com/p/alsing
0 stars 0 forks source link

Attempted to read or write protected memory. This is often an indication that other memory is corrupt. #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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...

Original issue reported on code.google.com by CadCamG...@gmail.com on 4 Jul 2008 at 4:18

GoogleCodeExporter commented 9 years ago
Ok, 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

Original comment by trspraypaint on 16 Feb 2009 at 2:00

GoogleCodeExporter commented 9 years ago
Hi.

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.

Original comment by marcelo....@gmail.com on 19 Dec 2009 at 1:49