我已经把窗口页面大部分不相关的控件和代码都删掉了,只剩下combox, textbox and numericupdown三个控件,可是问题还是发生,太奇怪了,太妖怪了,会不会是微软的问题?怎么解决?
而且我的程序是在.net3.5的环境下面运行的--vs2008See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
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& m)
   at System.Windows.Forms.Control.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

解决方案 »

  1.   

    Attempted to read or write protected memory也不排除硬件问题,内存条上的灰尘,影响读写性能稳定性.
      

  2.   

    和重起机器没有关系,在很多机器上都试过了,都有这个问题
    我找到了一个类事的问题
    http://topic.csdn.net/u/20080122/17/f649c13d-ee5f-474b-b913-13895c1c8488.html
      

  3.   

    你什么操作系统?win2003试过没有?
      

  4.   

    我的系统是win2003,当然xp也试过的
      

  5.   

    贴代码啊   没有引用第三方dll? 或者是否进行了什么错误的赋值操作?
      

  6.   

    恩……看起来是TextBox处理消息出错了,你删掉TextBox看看还有没有问题
    或者,新建一个项目,就一个TextBox,看看会不会出错
      

  7.   


    楼主给的那个错误信息你看得出来是TextBox的问题?高手。
      

  8.   

    我想是你的方法错了,应该是先建一个干净的工程,做自己需要用的combox, textbox and numericupdown,建立相应的事件后,将源工程上的对应代码CCCV过来。如果程序报错,需要调用其它代码,再把这段代码拷过来,这样的工程才又干净又稳定。