Funny mistake

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu