2 Replies - 2551 Views - Last Post: 21 May 2009 - 01:52 AM Rate Topic: -----

#1 galorin  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 86
  • Joined: 17-February 09

C + Win32 DestroyWindow stack overflow

Posted 20 May 2009 - 07:59 AM

When I use DestroyWindow(hWnd) on a child window, I get a stack overflow. The window is created in a function call. How can I toggle the window visible/hidden rather than destroying it when WM_DESTROY comes along?
Is This A Good Question/Topic? 0
  • +

Replies To: C + Win32 DestroyWindow stack overflow

#2 Jubb  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 88
  • Joined: 06-May 09

Re: C + Win32 DestroyWindow stack overflow

Posted 20 May 2009 - 08:21 AM

Yes...destroywindow is very unsafe. There is a method call to hide the window, but maybe you should send a message to that window telling it to close, instead of forcing it to die or just making it invisible.
Was This Post Helpful? 0
  • +
  • -

#3 galorin  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 86
  • Joined: 17-February 09

Re: C + Win32 DestroyWindow stack overflow

Posted 21 May 2009 - 01:52 AM

View PostJubb, on 20 May, 2009 - 07:21 AM, said:

Yes...destroywindow is very unsafe. There is a method call to hide the window, but maybe you should send a message to that window telling it to close, instead of forcing it to die or just making it invisible.


Ok, I've got the window closing without any errors, I tried hiding and unhiding, but the window process was still killed. Tried a few other things but I've wound up with a memory leak instead of a crash. Fun fun.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1