Using R 3.1
I am having 2 problems with my built and installed app. It is only on my machine.
The first one is a NilObject. The second is on closing the starting window closing to normally open another window it closes without warning. Neither of these appear in a debugbuild.
The first one is while displaying the About Box, I get a NilObject. I suspect it has something to do with the Xojo logo not displaying properly. The logo display is handled by a method called App,ScalePicture and you can see the difference. The name is displayed in the box. The problem with that theory is it should be caught by the Try Catch.
Here’s the code
Catch err As NilObjectException
#If TargetWindows Then
bmsg = New BoxMssage( 0, "The Picture Cannot be Used Because of " + err.ErrorNumber.ToText, "Picture", CurrentMethodName )
#Else
MessageBox("The Picture Cannot be Used Because of " + err.ErrorNumber.ToText)
#EndIf
Return Nil
Like I wrote above the other problem is the application closes unexpectedly when I close the first window and the window calls for the main window to open (via mainwindow.show). One can also quit from the first window, but I have verified it isn’t following that path.
In case it matters, I’m using Actual Installer.
Suggestions?
The Xojo logo is visible in both cases… its not the logo that is the issue.
What is the EXACT line that generates the nilobject exception?
(if this does not happen in debug mode, add some debugging code to test the objects referred to in this method…
eg
if ThePicture = nil then messagebox “ThePicture was nil”
if btnClose = nil then messagebox “btnClose was nil”
and so on.
)
application closes unexpectedly when I close the first window and the window calls for the main window to open (via mainwindow.show)
mainwindow.show will only work if you have ImplicitInstance set to true.
Otherwise you would need to do this as
BoxMssage is what I use on Windows in place of MessageBox. They get stuck and my only conclusion is the scale or size of my app. When I remove window and classes MessageBoxes work.
The Main window is set to implicit instance.
This whole thing works fine in for 2021 R2.1. The logo displays properly and Main open just like it should.
Have you set App.AllowAutoQuit to false earlier in your code?
If there’s no longer any open window (even if one may open later), the behaviour with AllowAutoQuit=true on Windows is to quit.
Wow. That solved two of the problems.
I now get no NilObject and it doesn’t mysteriously close.
I had created a boolean App.QTing so it was easy to monitor but hadn’t considered AllowAutoQuit
The boolean part of the code to tell it close is below.
appQuitting = True
App.QTing = True
The logo is still displayed incorrectly…
I’ll see if I can work up a small version of the about box.
Can you also add more information to your case? Things like OS affected if windows 32bit, 64bit or both, etc.
You may need to add a sample to the Feedback case. I tried to reproduce the problem, a simple “Hello World” is not adding the database dlls to the compilation. At least with Xojo 2019.