title: Pass object from Javascript to C++/CX based on C++/CX interface - Windows Runtime Components
body: <p>I'm new to Windows Runtime Component, and have been trying to figure out how to achieve the following.</p>
  
  <p>The C++ interface I want to extend from in Javascript.</p>
  
  <pre><code>namespace MySDK {
      public interface class LoggerPlugin
      {
      public:
          virtual void Log (Platform::String^ Tag, Platform::String^ Messsage);
      };
  }
  </code></pre>
  
  <p>The C++ </p>
  
  <pre><code>namespace MySDK {
      public ref class Logger sealed : public Platform::Object
      {
      public:
          static Logger^ GetInstance ();
          void SetPlugin (LoggerPlugin^ Plugin);
      };
  }
  </code></pre>
  
  <p>What I tried, may seem silly, but I have no idea how to achieve it.</p>
  
  <pre><code>var plugin = {
       log: function(tag, message) {
            console.log(tag + ':' + message);
       }
  };
  
  MySdk.Logger.getInstance().setPlugin(plugin);
  </code></pre>
  
  <p>The error that I get is </p>
  
  <pre><code>JavaScript runtime error: Type mismatch
  </code></pre>
  
  <p>I couldn't find any documentation or examples on how to achieve this, will appreciate if anyone could provide me an example of how this can be done.</p>