App is not starting

I’ve written some apps running on my machines with the newest version of macOS and Windows.

But there is a customer notebook with Windows 10 on which the “one” app at startup does not display the main window.
If I look at the running programs with the shortcut + , then there is a blank screen of the non-starting app to see.

What can be the reason for this?

I think that all necessary DLL files come along with the app: msvcp120.dll, msvcp140.dll, msvcr120.dll, vccorlib140.dll, vcruntime140.dll, XojoGUIFramework64.dll and all the DLL of the LIBS folder.

Off the top of my head:

Does the icon appear on the taskbar?
Is the user on a multiuser system or logged in as a second user on the system?
Have you sent them a simple blank test app to test to see if its a xojo issue or your code issue?
Do you use any declares?
What version of xojo are you using?
Do you do anything with window positions or monitor detection?

Virus checker.
Unpacking to OneDrive/iCloud
WIndows message popped up , maybe behind another app?
Main window has opened with a size of 0,0

One other question in addition to the above:

is it a 64-bit application on a 32-bit OS?

The icon is on the taskbar.
The user is logged on in a Windows 10 notebook - single user.
Other Xojo-Apps are running.
Once the app had run on the notebook, but it was before Windows 10 becomes installed. The app has no declares that do not have other working Xojo apps.
I use 2019r2 but it was the same with 2019r1.
The notebook has a second screen - I will check it.

I’ve startet only my app.
I can not verify whether it has a size of 0,0
The app is a 64-bit application.

It seems like your app isnt getting to its running state, its getting caught initialising something on the window. Do you have anything special in the paint/open of the window?
If they hover over the icon on the taskbar do they also see the blank looking window?
Does the app load anything on startup that could be in the wrong place due to migration from <10 to 10 ?

Short of making them a special build with msgbox progress alerts at various stages or putting in some heavy logging to file its really hard to say.

The app has a page panel, some list-boxes, many textfields and a formatted text control (FTC 3.2.1).
The app is running on my private Windows 10 notebook. One difference to the other notebook is, that Xojo is installed on my private notebook.
One newer thing is at opening event the start of a thread for checking the Sqlite database.

Is the SQLite database in a user-dependent folder (documents, etc.), and if so, is the user that installed the app the same as the user running the app? If they are two different users, then I would suggest to move the sqlite database to the correct folder for the user.

The database is into the same folder as the app is because it must be possible to execute the app on an USB stick. The database contains no user specific items.
I suspect that some DLL is missing. Since the notebook is running in a secure network, it may be that the program is blocked by something?

It maybe that the window is located off the screen. Click on the icon in the task bar, press + which should change the mouse cursor. Then click on the screen to move it back.

Do you gracefully deal with errors reading from the database?
If you select “Include Runtime DLL’s” in xojo it will include all required dll’s, the app wont start if any are missing, however just to be on the safe side, try getting them to install the relevant runtime installer from C:\Program Files\Xojo\Xojo 2019r2\Extras\Windows Runtime\Installers

First of all: Thank you for your support!!!

The short cut + brings me the screen back. And now I understand the problem. The app stores the last coordinates of the main window at closing and restores the position at opening. The app is on a USB flash drive and the last call of the app was on an iMac with 4K screen. The notebook has only 1920 x 1080 pixels.

The problem was sitting in front of the screen :slight_smile:

I’ve been caught by that too, which is where the size of 0,0 came from.
Failed to read the co-ordinates properly and didnt have a sensible ‘default’ value set up.

Yes, Jeff. Now I only know what was meant by “Main window has opened with a size of 0,0”.

a) You can check if the screen sizes is smaller than the saved values.
b) I had a user whose windows were on a second screen. Then he was at a location where he had only one screen. He wasn’t able to access his windows at all. So I made a “Collect Windows” menu item:

[code]if ScreenCount = 1 then Return True

for currentWindow as Integer = 0 to App.WindowCount
dim ScreenID as Integer = getScreenID(App.Window(currentWindow))
if ScreenID = -1 then
Continue
ElseIf ScreenID > 0 then
'center window on middle of screen 1
App.Window(currentWindow).Left = (Screen(0).AvailableWidth - App.Window(currentWindow).Width) / 2
App.Window(currentWindow).Top = (Screen(0).AvailableHeight - App.Window(currentWindow).Height) / 2
end if

next

Return True[/code]

The result isn’t really pretty, but the windows are visible again.

Thanks for the code of centering a window at the current screen.

It looks to me as though it puts the top left corner of the window in the center of that screen – not centering the window per se. But that certainly should have the effect of making the window visible and easily draggable to elsewhere. It also looks like has no effect on windows that are are screen(0) but perhaps off-screen. I’m sure that is more rare, but I suspect still possible. Like if last used with a 4k/5k external monitor (that became screen(0) due to clamshell mode), the window position was saved as towards bottom right, then restored to those offset while in laptop mode.

So I’d probably do >= 0 instead of > 0 in the ElseIf, or simply do Else when not ScreenID = -1

That said, I bet the code as written nearly always makes the window visible again.

[quote=463964:@Beatrix Willius]a) You can check if the screen sizes is smaller than the saved values.
b) I had a user whose windows were on a second screen. Then he was at a location where he had only one screen. He wasn’t able to access his windows at all. So I made a “Collect Windows” menu item:

[code]if ScreenCount = 1 then Return True

for currentWindow as Integer = 0 to App.WindowCount
dim ScreenID as Integer = getScreenID(App.Window(currentWindow))
if ScreenID = -1 then
Continue
ElseIf ScreenID > 0 then
'center window on middle of screen 1
App.Window(currentWindow).Left = (Screen(0).AvailableWidth - App.Window(currentWindow).Width) / 2
App.Window(currentWindow).Top = (Screen(0).AvailableHeight - App.Window(currentWindow).Height) / 2
end if

next

Return True[/code]

The result isn’t really pretty, but the windows are visible again.[/quote]

dont set TOP and LEFT
they refer to the CONTENT AREA of the window
set the BOUNDS as I mentioned before

Using the Bounds to set the window position is an awful kludge. Here I only care about showing the window again so I use simpler code.