Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / UAC invalidates images?

Author
Message
void
13
Years of Service
User Offline
Joined: 4th Aug 2011
Location:
Posted: 7th Aug 2011 10:19
While I was doing some setup on a target machine, I left my demo application open in the background while I installed some tools.

It seems that when UAC triggers, I get the following error:

Runtime Error 501 - Image number illegal at line 394

I even tried adding this immediately before the line in question:
if screen invalid() then makeimage()

I've managed to repeat the issue multiple times. A minimal test case is attached; simply execute that, leave the window running, and trigger UAC. I'm using the indigo beta installer (since I was setting up my DBP toolchain on the machine).


Yes, normally I would have UAC disabled, but this is a new machine, and UAC is likely to be enabled on end user machines anyway, so it'd be helpful to know how to prevent this problem.

Attachments

Login to view attachments
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Aug 2011 22:37
Using UAC triggers a resolution change, which in turn forces DirectX to flush the graphics buffer of all graphical elements loaded in. This isn't a DBP issue, its an unfortunate side effect of the way Windows/DX have been made.

In order to prevent this from happening, you need to check each and every time a graphical element is used that it exists still, and if not, call your media loading function again.

Hope that helps.

Login to post a reply

Server time is: 2024-11-24 03:07:30
Your offset time is: 2024-11-24 03:07:30