title: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Windows forms
body: <p>I am getting the exception</p>
  
  <p>Attempted to read or write protected memory. This is often an indication that other memory is corrupt.</p>
  
  <p>When opening a window from a windows form. The strange thing is it is occurring only in one system(client). I tested the application on my system and it works without any exception.</p>
  
  <p>Stack trace is below</p>
  
  <pre><code>System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
     at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
     at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
     at System.Windows.Forms.Control.DefWndProc(Message&amp; m)
     at System.Windows.Forms.Control.WmKeyChar(Message&amp; m)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.TextBoxBase.WndProc(Message&amp; m)
     at System.Windows.Forms.TextBox.WndProc(Message&amp; m)
     at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message&amp; message)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  </code></pre>
  
  <p>I am using the following way to open the sub form</p>
  
  <pre><code>subform = new subform(parameters)
  subform.show();
  </code></pre>
  
  <p>Thanks for your help.</p>