Application crashes in Windows

Hello!

I have a strange problem and I don’t know where to start solving it.

I wrote an application for managing student data; as always I developed it on MacOS and compiled it for MacOS and Windows. At first you have to login, and then the main window (Window1) opens. I did not do anything different than the dozen times before I wrote a program this way, and it works just fine on my Mac.
But on Windows the program crashes when it builds Window1 (there’s no difference if I login first – which works well – or if I run Window1 directly without the login routine). The window frame appears and than a Windows dialogue opens which says that Application.exe cannot be executed due to a problem (which is not specified); then Windows tries to find a problem solution and finally quits the program. Since there is no error code or something similar, I simply cannot find the problem; removing everything from the Open event did not help. And like I said: I did everything the way I always do and never had a problem like that.

I just downloaded Xojo on my Windows machine and ran the program directly in Windows from the project code to see if the debugger shows a hint what is goint wrong, but it doesn’t show any error. Still the problem remains also if the program is compiled and ran from Windows.
And now I am completely helpless with that …

Windows 7?

Windows 10

Perchance is there any platform specific code (declares for example) that are not properly fenced off with #IF TARGET?

Start removing controls on Window1 until it no longer crashes. Then, add that control back in without any events. Then add the events (and code) back in. If not that, then start commenting out entire methods. Hopefully, somewhere along the way you’ll find it.

I had to do this recently in Windows where I had complex lines of code and once I found that it wasn’t the controls, I found the method that was causing the issue. I started by remote debugging and figuring out which line of code it was crashing on and then I started simplifying code. So for me there was nothing wrong with the code, but for some reason the compiler couldn’t handle it properly.

Sadly, I can’t report it because it’s in a 2 year old version of Xojo and there are a number of things in this project that keep me from upgrading.

@Dave: Only one declare, but it is properly fenced off.

@Bob: I fear I have to do it that way. The strange thing is that I have only controls and methods in it I already used in an older project where it worked without any problem…

I found it: In the CellBackgroundPaint event of a listbox I had a condition that the instance of a certain class my not be Nil; after removing the condition the program starts fine. Still, I don’t get what the problem was, particularly because the debugger didn’t show any problem at all