Windows 10 user cant see controls

An issue I have never seen before:
64bit WIndows build, made with Xojo 2023

One (only one) customer reports that although windows appear, controls that should be on them such as listboxes & canvases do not appear.
Labels do, however.
No error messages appear.

Has anyone seem similar? What might cause that?

Very low on memory? Seems unlikely. In the old days being out of graphics handles was a thing, but that was like 16bit times.

Windows uses a concept of handles.
if you run out of handles, controls can’t be created anymore. Then .handle properties of the controls will be zero.

That can happen if you open thousands of windows until you run out of handles.

Maybe just ask user to restart computer.

2 Likes

Second thing I suggested. (First was 'install a version from 3 months ago)

Their response:

Windows 10 Pro 64 bit
Intel i5-2450M
4 GB RAM
Windows Defender and Malwarebytes
I do not use OneDrive, but I tried restarting, it did not work.

Im stumped.
It FEELS like the Xojo DLL containing the controls is disabled/missing (doesnt seem to be) , but I would expect an error of some kind.

I’ve seen funky behavior with controls disappearing when I catch exceptions in socket event handlers. It was absolutely bizarre and I gave up debugging it, I ended up letting those exceptions just bring down the app.

Are the controls not there from the start or after some period of time. If it’s right away then I would look at removing everything to do with the app and re-installing it.

This is very limiting for a Windows machine and may be related if your problem is spurious. Does it work at least a bit after a restart?
Also get the Win 10 build number, let’s see how old it is.

Something similar happened to me recently when I upgraded my old monitor to a 4K one. Controls did not show - just white space. Turns out it was caused by my equally ancient graphics card (Win10 setup). It was fixed when I reduced the screen resolution. The PC is almost 9 years old. I need to upgrade!

Just a blind guess
 it might be be because of Xojo’s “Hardware Rendering” (by default).

You could try to add this in App.Open (as early as possible):

#if TargetWindows and TargetDesktop then
'Windows: D2D Software-Rendering
System.EnvironmentVariable("XOJO_D2D_SOFTWARE_RENDERING") = "True"
#endif

Or explain to the user how to set the environment variable in cmd.exe, then launch your app with this environment variable set. Or write a simple .bat (which sets the environment variable and then launches your app).
Just to see if that would resolve the issue if the Xojo built app runs with “software rendering” instead.

Fast test using current binary.

From CMD, type:

SET XOJO_D2D_SOFTWARE_RENDERING=TRUE

THENAMEOFYOURAPP.EXE

Thanks for these suggestions, will pass along!

Software rendering made the difference, thanks @JĂŒrg_Otter and @Rick_Araujo

If I implemented that permanently, what are the implications for ‘everyone else’ -would it slow ‘most users’ down? (eg does this move the rendering away from the graphics card?)

That’s what I’ve suspected since only all the ‘graphics controls’ (Canvas, Listbox) doesn’t show


Try yourself if you notice a big difference. I doubt that you’ll notice it in an ‘Office style app’, while you might notice it in a ‘graphics intensive app’ such as a game.

Or have just the affected customer set that environment variable permanently/globally in Windows settings on his old machine


i remember where i had this invisible controls partly in the xojo ide itself (2019)
the workaround was this environment variable for a while too.

Yes. So make it optional as a last resource. Make a config in your app to save an option “Use Software Render” and at the app.open() check that value, and if true, do what Jurg suggested:

System.EnvironmentVariable("XOJO_D2D_SOFTWARE_RENDERING") = "True"

In case of some crash not enabling the user to access your “config panel” to set this option use the CLI trick to access the panel once.

Interestingly, adding it to the App’s Open event didnt work.
I’ll use a BAT file or Control Panel

So, sadly the graphics system init occurs before it and the user don’t have a runtime option, just a system wide option. At runtime, in your config options, you could set the environment variable in a persistent way and quit. Next time the app would use it.

The theory is that if you write “TRUE” as the value of " XOJO_D2D_SOFTWARE_RENDERING" in the registry path “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” (probably will need admin rights) it will persist system widely.

https://documentation.xojo.com/api/windows/registryitem.html#registryitem-constructor1

For the current user only the path is HKEY_CURRENT_USER\Environment