problem: Service, with COM based UI, and fast user switching...UI ends up on wrong user

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Russ Freeman (r_at_fatbird.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 14:06:09 +0100

I wish to have a service provide a COM based GUI. The application I have in
mind is quite complex but the only UI I need ATM is one called Show (
bShow ). A simple VBS test file is used to test it.

So I hacked a test app that does what I want and the Show method simply
displays a MessageBox. But I instantly had problems...

I had two users running (using fast user switching) on my machine and I was
logged into the second one. When I started my service and tried a test
client to display the Show method nothing happened. When I switched to the
primary user I saw the MessageBox - somehow the UI for the service was
appearing on a different logon. If I run it not as a service then all is
fine.

The service has the Interact With Desktop flag switched ON. The service is a
stick ATL out of process service with just one interface and one method.
It's a very basic test.

Anyone know what's going wrong and how I can fix it?

Sorry if I didn't explain it well enough...if it's not clear I'll have
another go ;)

My only alternative to this approach is to open up all of the code to make
it COM based and make the client code use the new COM interfaces. The
difference between the two approaches can be measured in man months so I'd
love to get the above solution working as expected.

-- 
russ.
http://www.gipsysoft.com/articles/winspector/ - FREE Spy++ replacement.
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids


Relevant Pages