Funny mistake
- Posted by Ian Burleigh <igb at HOME.COM> Jan 05, 1999
- 447 views
Initially the code was: ---------------------------------------------------------------------------- --- constant iDestroyWindow = define_c_func(g_user32,"DestroyWindow",{C_POINTER},C_INT) global function DestroyWindow(atom hwnd) return c_func(iDestroyWindow,{hwnd}) end function ... atom r r = DestroyWindow(hFrameWnd) ... ---------------------------------------------------------------------------- --- Then I realised that I never check the value returned by DestroyWindow, so I changed the function to a procedure to spare me the trouble with trashing the retrun value: ---------------------------------------------------------------------------- --- constant iDestroyWindow = define_c_proc(g_user32,"DestroyWindow",{C_POINTER}) global procedure DestroyWindow(atom hwnd) return c_proc(iDestroyWindow,{hwnd}) end procedure ... DestroyWindow(hFrameWnd) ... ---------------------------------------------------------------------------- --- The code still run but evidently worked not. It was not destroying the window. Silly mistake. Ian