locked
Attempted to read or write protected memory. This is often an indication that other memory is corrupt RRS feed

  • Question

  • Hi,

    Iam working on a Visual studio2012 plugin development using Visual studio SDK 2012. Iam getting an error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." My application has one UI thread and one child thread. The same project executes well in VS2010.

    For example,

    In the below model code while accessing  Class1.Method2() from child thread iam getting an error.

    Class CustomProjectNode: Project Node{

    Class1 class1Obj =new Class1();

    class1Obj .Method1(this);

    }

    Class Class1

    {

    CustomProjectNode customProjectNode;

    Method1(CustomProjectNode customProjectNode)

    {

    this.customProjectNode=customProjectNode;

    WindowsForm  windFormObj=new WindowsForm(this); 

    }

    Public void Method2()

    {

    this.customProjectNode.SomeMethod();

    }

    }

    WindowsForm:Form  

    {

     

    WindowsForm(Class1 class1Obj)

    {

    Thread threobj=new Thread(class1Obj.Method2);

    threobj.start();

    }

    }

    I could not use this.Invoke((MethodInvoker)delegate. Since my child thread code is not related to UI control class.

    Kindly could you help me to resolve this issue.

     

    Thanks & Regards,

    Ellaiyaraja.B


    Thanks & Regards, Ellaiyaraja B

    • Moved by CoolDadTx Tuesday, May 21, 2013 8:34 PM Extensibility related
    Tuesday, May 21, 2013 7:48 PM

All replies