Invalid Pointer Operation - Delphi XE

前端 未结 4 1591
庸人自扰
庸人自扰 2021-01-02 05:20

I can\'t seem to figure this one out. My program compiles and runs successfully, but during debugging only it pops up a message box saying \"Invalid Pointer Operation\" when

4条回答
  •  一生所求
    2021-01-02 05:40

    A 4th reason an invalid pointer operation can occur. I had two pointers that where array[0..1000] of real and a third pointer that was an array[1..200] of real. All 3 pointers where initialized with for i := 0 to 1000 do begin ptr1^[i]:=0;ptr2^[i]:=0;ptr3^[i]:=0; end; While this poor programing did not bother Pascal in Delphi a call to Dispose any of the 3 pointers resulted in an Invalid Pointer Operation. The fix was simply to initialize the 3rd pointer correctly.

提交回复
热议问题