How to solve the problem about using my own effect component will report "ClassFactory cannot supply requested class" in Metro? RRS feed

  • Question

  • Hi MS expert,

    I have a problem to add effect to webcam. I write a component using native C++ named as "EffectCom.GrayCom.NewGray" which re-write code like "Grayscaletransform.dll" including in sample "Media Plugins Sample". When the component is invoke from JS project, it reports "ClassFactory cannot supply requested class". 

    Followings are some snapshot for the problem.

    1. Component definition is:



    public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::WinRtClassicComMix>,

    Microsoft::WRL::CloakedIid<IMFTransform>,INewGrayEffect>  {

    spectableClass(RuntimeClass_EffectCom_GrayCom_NewGray_NewGrayEffect, TrustLevel::BaseTrust);





    2. JS code like

    var effect = new Windows.Foundation.Collections.PropertySet();

    effect["effect"] = "GrayEffect";

    mediaCaptureMgr.addEffectAsync(Windows.Media.Capture.MediaStreamType.videoPreview,"EffectCom.GrayCom.NewGray", null).then(

    Beside the problem, I have another question for addEffectAsync. Is there another solution or method to call the effect component directly in Js solution?

    Looking forward to your feedback.

    Thanks in advance,


    Tuesday, January 3, 2012 9:14 AM


  • Hello Jun-Yi

    Stan showed how developers could write their own MF plug-ins and use them from Metro at the “build” conference. Unfortunately the sample code that he used at “build” has not been made public at this time. I am currently working closely with Stan to get the sample code released and will make sure to update the development community as soon as it is ready. I will make the announcement on my blog as soon as we have the cleaned up code.

    Thanks for your patience,


    Windows Media SDK Technologies
    Microsoft Developer Services


    Friday, January 6, 2012 11:05 PM