Subclassing crash
- Posted by George Papadopoulos <georgp at otenet.gr> Jan 24, 2003
- 490 views
Hi all Please, take a look at this: --=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D function ControlProc (atom hWnd,atom wMsg,atom wParam,atom lParam) integer c , ret c=3D1 ret=3Dc_func(CallWindowProc,{SubControl, hWnd, wMsg, wParam, lParam}) if c then end if return ret end function SubControl=3Dcall_back(routine_id("ControlProc")) --=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D It's the hook procedure for a subclassed control. On execution, i get a machine level crash with a message like: "The instruction at 0040bd67 referenced memory at fffffff8 The memory could not be read from Click on OK to terminate the application" If i comment line "if c then end if", works ok. It seems like var c has been destroyed. If i declare c outside the function, works ok, also. Why does it happens? Thanks -George-