I have a background application that runs and listens for events while media center is running. This works completely fine on Win7 but on Vista the Media Center Navigates to an empty page after starting the background application but the application shouldn't navigate at all. Is this some misconfiguration on my part or does Vista MC always do this?
Can you post your registration.xml file please, and your Launch method.
Cheers,Andrew
When I was looking for the relevant code to post. I saw that I created a PageSession that is not used in the Background-Application. This was a leftover from a test. It seems that just the creation of this lets Vista navigate to the empty page and Win7 MC doesn't mind.
Thanks for forcing me to take a second look at my code... I didn't notice this when I first examined the code for any hints why it does this navigation.
Hi,
Could you please tell me how you wrote the Launch method? For some reason, I can't make my background code persistent. I register for some events in the launch method, but as soon as the execution of the code in the Launch method finishes, my application terminates.
Thanks a lot,
That's the expected behaviour of the Launch method in a background add-in. Once the Launch method completes, the add-in exits. You'll need to start a new thread in your add-in to run your code, and use a mutex or similar to keep the Launch method running until you are ready to close it.
Thanks a lot for the reply. I'm not sure if I'm doing it right or not, but I can create a thread so the program doesn't terminate right away, but I no longer can catch events from media center environment. I have tried both putting the "register event" code in application thread and the second thread I create. Is there a special way I should do it?
Again expected behaviour (unfortunately). Events only occur on the "application thread" (the thread the Launch method started on), which you are now blocking to make sure your background addin doesn't complete. If you subscribe to the event in your launch method, you'll see the queued events fire once your launch method continues (e.g. if you had a mutex, when the mutex is released).
Hmmm, so how do I actually go about catching events in my background addin? That's really bizarre.
Which events specifically are you trying to catch?
CheersAndrew