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.
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.
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.
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âŠ
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:
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.