window close button 64-bit not working

Odd behaviour; my App compiles and runs fine in both 64 bit and 32 bit.
But closing the main window on the 64-bit version, causes a hang,
whilst the 32-bit version closes and quit just fine. has autoquit = true and cancelclose has a quit.

Any ideas why the 64-bit behaves differently?

I suspect you’ve got an infinite loop by calling quit in CancelClose.

@Greg O’Lone : How could I just have an infinite loop when compiling 64-bit?

Please try it. It wouldn’t surprise me if calling Quit in CancelClose triggers another CancelClose event… or at least, don’t call Quit when AppQuitting=True

@Greg O’Lone : I tried a few variations and removing the close and cancelclose events from the App,
and retaining a quit in the Main window’s CancelClose worked.

It’s a tad confusing but at least it quits now in both 32-bit and 64-bit.
Thanks Greg

As Greg has advised you, calling quit from cancelClose is not the correct construct. CancelClose needs to return a Boolean, then the app closes. By leaving it the way you have it, you are asking for more trouble down the road.

I short words: just Return False in the CancelClose Event, to close the App :wink:

Understand the CancelClose Event as a question “Cancel the close event?”. You return FALSE if you don’t want to cancel it. :slight_smile:

Thank you all for the replies, now I finally know the proper way to quit, I’m always thrown off by double negatives :wink: