/// <summary> /// During SetClientSite, WMP calls this function to get the pointer to <see cref="RemoteHostInfo"/>. /// </summary> /// <param name="guidService">See MSDN for more information - we do not use this parameter.</param> /// <param name="riid">The Guid of the desired service to be returned. For this application it will always match /// the Guid of <see cref="IWMPRemoteMediaServices"/>.</param> /// <returns></returns> IntPtr IOleServiceProvider.QueryService(ref Guid guidService, ref Guid riid) { //If we get to here, it means Media Player is requesting our IWMPRemoteMediaServices interface if (riid == new Guid("cbb92747-741f-44fe-ab5b-f1a48f3b2a59")) { IWMPRemoteMediaServices iwmp = new RemoteHostInfo(); return Marshal.GetComInterfaceForObject(iwmp, typeof(IWMPRemoteMediaServices)); } throw new System.Runtime.InteropServices.COMException("No Interface", (int) HResults.E_NOINTERFACE); }