i'm trying to create a MSAS sink on my Win 7 box. it's a x64 Ultimate. i'm following this blog post.http://damianblog.com/2008/05/20/creating-msas-sinks-in-c/
looks like all of my registry keys are in place. they're not in the WOW64 tree. one thing i detected is that ehmsas.exe isn't started automatically by the Media Center.perhaps it's because the deprecation notice in the 6.0 SDK? but if i start ehmsas.exe by hand, it looks lke the sink isn't called. if i look at the loaded dll's with Process Explorer i can't see that my dll is loaded by ehmsas.exe. any hints or pointers here?
regards
ehMSAS.exe *is* started automatically by Media Center, however if there are no attached sinks, it stops again.
Check your registration entries are correct, including version numbers and public key for your assembly.
Ceers,Andrew
What is the today recommend method to program or access the actual play state from Media Center ?I ask this because in the new Media Center 7 SDK (6.0) MSAS is marked as depreciated.
DanB#
I don't think there is any method that is specifically recommended. You can get play state from the transport object, or you can get it from MSAS. While MSAS is marked as deprecated, it is fully implemented in Windows 7. What the deprecation marking is saying is that it may not be in future versions of Windows. Given the lifetime of Windows 7, I wouldn't be worried about that for stuff you do today - you've got some time before Windows 7 will go away.
Cheers,Andrew
i see. it's started indeed and stops immediately. registry entry looks ok. just for my understanding. i create a new registry key:
HKLM\SOFTWARE\Classes\CLSID\{GuidAttribute from the class implementing MediaStatusSink}\Implemented Categories\{FCB0C2A3-9747-4C95-9D02-820AFEDEF13F}
where the last guid marks this as a sink implementing the interface, right? i don't have any version numbers or public keys in the registry from this assembly.only the reference by the guid and the installed assemblies in the GAC. so if ehmsas is looking at this place it should load the COM visible class from the GAC referenced bythe guid. or am i missunderstanding something here?
AndyC I don't think there is any method that is specifically recommended. You can get play state from the transport object, or you can get it from MSAS. While MSAS is marked as deprecated, it is fully implemented in Windows 7. What the deprecation marking is saying is that it may not be in future versions of Windows. Given the lifetime of Windows 7, I wouldn't be worried about that for stuff you do today - you've got some time before Windows 7 will go away. Cheers,Andrew
Hi Andrew,
thx for your feedback. OK, i understand. Maybe i will ask again in 3 Years ;-)
Greetings,DanB
pantarhei,
Your registry entries should look like this:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{implementing guid}]@="MyMediaStatusSinkAssembly.MediaStatusSink"
[HKEY_CLASSES_ROOT\CLSID\{implementing guid}\Implemented Categories]
[HKEY_CLASSES_ROOT\CLSID\{implementing guid}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}]@="Media Status Sink"
[HKEY_CLASSES_ROOT\CLSID\{implementing guid}\Implemented Categories\{FCB0C2A3-9747-4c95-9d02-820AFEDEF13F}]
[HKEY_CLASSES_ROOT\CLSID\{implementing guid}\InprocServer32]@="mscoree.dll""ThreadingModel"="Both""Class"="MyMediaStatusSinkAssembly.MediaStatusSink""Assembly"="MyMediaStatusSinkAssembly, Version=x.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxx""RuntimeVersion"="v2.0.50727"
[HKEY_CLASSES_ROOT\CLSID\{implementing guid}\InprocServer32\3.5.0.0]"Class"="MyMediaStatusSinkAssembly.MediaStatusSink""Assembly"="MyMediaStatusSinkAssembly, Version=x.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx""RuntimeVersion"="v2.0.50727"
[HKEY_CLASSES_ROOT\CLSID\{implementing guid}\ProgId]@="MyMediaStatusSinkAssembly.MediaStatusSink"
Where "{implementing guid}" is the one you've used in your COM visible class, "MyMediaStatusSinkAssembly" is your assembly in the GAC, and MyMediaStatusSinkAssemlby.MediaStatusSink is the class implementing IMediaStatusSink.
Make sure the version numbers and public key token are also correct, and your assembly is in the GAC or it won't load.
Andrew, you made my day. better. you made my next week. :) so happy that it is working now. man i was missing a lot of registry entries. is there an official documentation where to find these keys or is it just known by a few privileged/experienced? for me as a beginner it's hard to find the needed information without asking here. but great to see that we'll get help that fast.
thank you so much.
If you download the Vista Media Center SDK the Event Sink is documented there along with a sample. In terms of the registry keys that is something you need to know for COM programming.
btw, If you do look at the C++ Event Sink sample in the SDK do not install it on a "production" machine. It is riddled with memory leaks and poor COM programming practice, reminds me of COM programming you'd see back in NT 3.5
AndyCWhile MSAS is marked as deprecated, it is fully implemented in Windows 7.
While MSAS is marked as deprecated, it is fully implemented in Windows 7.
It is fully implemented but it also has the same bugs that is had it Vista =/
everything works fine expecting my linksys extender. after setting AlwaysUseFPD= 1 like described here [1] another ehmsas process is spawn if the extender starts. but this ehmsas process has no more infos in Process Explorer. there's no Image Type no Description. nothing. just a "dead" process.
i thought after setting AlwaysUseFPD every extender spawns a new session and it will receive the events too. but a session is never created. am i missing here another crucial point?
[1] http://discuss.mediacentersandbox.com/forums/permalink/3443/3456/ShowThread.aspx#3456
Is the assembly in the Global Assembly Cache (GAC)? If it's not in there, the extender won't be able to find it.
yes it is. on the host it's loaded from the GAC after the registry keys you told me where in place.
these two assemblies are loaded within the ehmsas.exe process that is started after the Media Center starts.
C:\Windows\assembly\GAC_MSIL\TestPlugin.Status\1.0.0.0__e9b33267ee70ac64\TestPlugin.Status.dllC:\Windows\assembly\GAC_MSIL\Interop.ehMSASLib\1.0.0.0__e9b33267ee70ac64\Interop.ehMSASLib.dll
What is the Interop.ehMSASLib entry? There's no interop required for MSAS.
it's auto genreated by Visual Studio after adding a reference to the ehmsas.exe. as in the blog post refered in my first message in this thread it should be registered in GAC too. i'm a bit confused now.