Hi,
My C# app throws the following exception:
System.AccessVi olationExceptio n: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The stack trace is as follows :
" at System.Windows. Forms.UnsafeNat iveMethods.Call WindowProc(IntP tr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n at System.Windows. Forms.NativeWin dow.DefWndProc( Message& m)\r\n at System.Windows. Forms.Control.W ndProc(Message& m)\r\n at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)\r\n at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg)\r\n at System.Windows. Forms.Applicati on.ComponentMan ager.System.Win dows.Forms.Unsa feNativeMethods .IMsoComponentM anager.FPushMes sageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo pInner(Int32 reason, ApplicationCont ext context)\r\n at System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo p(Int32 reason, ApplicationCont ext context)\r\n at WindowsFormsApp lication1.Progr am.Main() in D:\\TRUPTI\\02-02-2013-RNSB WithPaymentEdit \\RNSB\\RNSB\\P rogram.cs:line 25\r\n at System.AppDomai n._nExecuteAsse mbly(Assembly assembly, String[] args)\r\n at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()\r\n at System.Threadin g.ExecutionCont ext.Run(Executi onContext executionContex t, ContextCallback callback, Object state)\r\n at System.Threadin g.ThreadHelper. ThreadStart()"
My C# app throws the following exception:
System.AccessVi olationExceptio n: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Code:
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Login()); // get exception at this line(wen i try to enter details in text box)
}
" at System.Windows. Forms.UnsafeNat iveMethods.Call WindowProc(IntP tr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n at System.Windows. Forms.NativeWin dow.DefWndProc( Message& m)\r\n at System.Windows. Forms.Control.W ndProc(Message& m)\r\n at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)\r\n at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg)\r\n at System.Windows. Forms.Applicati on.ComponentMan ager.System.Win dows.Forms.Unsa feNativeMethods .IMsoComponentM anager.FPushMes sageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo pInner(Int32 reason, ApplicationCont ext context)\r\n at System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo p(Int32 reason, ApplicationCont ext context)\r\n at WindowsFormsApp lication1.Progr am.Main() in D:\\TRUPTI\\02-02-2013-RNSB WithPaymentEdit \\RNSB\\RNSB\\P rogram.cs:line 25\r\n at System.AppDomai n._nExecuteAsse mbly(Assembly assembly, String[] args)\r\n at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()\r\n at System.Threadin g.ExecutionCont ext.Run(Executi onContext executionContex t, ContextCallback callback, Object state)\r\n at System.Threadin g.ThreadHelper. ThreadStart()"
Comment