Couple of problems with built and installed App

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 )
    MessageBox("The Picture Cannot be Used Because of " + err.ErrorNumber.ToText)
  Return Nil

AboutBox Built
AboutBox Debug

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 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.

the scale method is probably not used correctly in relation with high DPI.

Maybe you just use a canvas there and in paint event use something like

g.drawPicture Logo, 0, 0, g.width, g.height, 0, 0, Logo.Width, Logo.Height

to fill the logo into the whole space.

1 Like

Thanks. I don’t try to use HDPI, so why would that matter.

I will try your idea.

What is a BoxMssage?

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…
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 will only work if you have ImplicitInstance set to true.
Otherwise you would need to do this as

dim   mw as new mainwindow

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.

So many questions, split the problem code out into a demo project and upload it.

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.

I wish there was an option in Preferences to NOT include the database DLLs. I don’t use them, but my app is 200 mb larger only because of them.

They shouldn’t be there if you don’t reference them in code
Try taking the plugins out of the plugins folder of Xojo, and see what complains.

I don’t get any complaints. I have been deleting them for years with no complaints. I think I filed a feedback suggestion. If not, it’s time.

I forgot I’d started to convert the imageviewer to canvas. Returned it and it all works.

Feedback suggestion made.

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.

Thanks. It’s updated with a project