Mega Search
23.2 Million


Sign Up

Make a donation  
Why are there Behavior Differences Under Terminal Services?  
News Group: embarcadero.public.delphi.vcl.components.using

Hi.  I have Delphi 7.  I am compiling in a win32 environment under Windows XP. Within my application, I have a method that enables several TImage buttons and sets captions for the TLabels. My form does have a customized onpaint event.  Within the method that modifies properties of the buttons, I'm logging, to an external file, whenever the onpaint event is triggered.

I copied the application to a virtual computer.  This virtual computer is using a Windows 7 64bit operating system.  I have two very different scenarios and I'd like to understand why there's two separate behaviors.  My application is very slow in the second case, and I believe it has to do with the remote desktop.  And if I can fix this, I'd like to know how.

1.  If virtual computer is running in remote desktop, close application and then logoff the virtual computer using the windows logoff to close the session completely.  With remote desktop, log onto virtual computer to start a new session. Start application, then end it when application is ready to accept input from user.  The onpaint event is *never* triggered within the method when the properties of the buttons and labels are modified.

2.  With remote desktop, close application and then disconnect virtual computer session without logging off. Log back into the already running virtual computer session using remote desktop.  Start application, then end it when application is ready to accept input from user.  The onpaint event is repeatedly triggered within the method when the properties of the buttons and labels are modified.  The onpaint is literally triggered each time a property setting is modified in code.  I have about 200 property v
alues I set in code, and *each* of them triggers the onpaint event.  The screen flickers as if it's a set of blinking Christmas tree lights.

The difference between scenario 1 and scenario 2 is about 2 seconds.  Same app, just different login methods to the computer itself.  Does anyone in this community have some ideas on why this happens?

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 22-Dec-2014, at 2:28 PM EST
From: Debbie Erickson
 
Re: Why are there Behavior Differences Under Terminal Servic  
News Group: embarcadero.public.delphi.vcl.components.using
Debbie Erickson wrote:

> 
> 
> The difference between scenario 1 and scenario 2 is about 2 seconds.
> Same app, just different login methods to the computer itself.  Does
> anyone in this community have some ideas on why this happens?

It's weird behaviour and I'm not sure I have the answer but I can tell
you one thing about virtual machines and remote desktop that I've found
- the redrawing and subsequent paint events vary greatly between client
connections to the machine acting as the RD server.  The biggest
optimisation in RD is in the area of how much of the screen needs to be
repainted, at what depth.  This is compounded by the virtual machine
having virtual graphics drivers.

Is it not easier to make it so that the change events on the controls
trigger a timer which then triggers the repaint (with timer code
written so it can get reset to avoid flickering)?

If you then are invalidating the screen/controls correctly you should
reduce the flicker.  It's not clear why you're repainting the screen,
is it the whole screen or just a region of it?  Is it possible to make
that area double-buffered?

Like I said, maybe not useful advice but with RD and VMs I've had
problems with things like a control which needed to draw on a graphic
(for dentists to show areas of work required).


-- 
IanB.
http://about.me/IanBarker

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Dec-2014, at 6:34 AM EST
From: Ian Barker