Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Fail to set port using SetMulticastGroup() of IMulticastConfig to "MPEG-2 Multicast Receiver" filter

Fail to set port using SetMulticastGroup() of IMulticastConfig to "MPEG-2 Multicast Receiver" filter

Scheduled Pinned Locked Moved C#
csharpc++pythongraphicsgame-dev
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andy Rama
    wrote on last edited by
    #1

    Hi to all, I am doing DirectShow Programming in VC++ & C#.Net. I am using "MPEG-2 Multicast Receiver" filter & using IMulticastConfig interface on it. In VC++, when I use SetMulticastGroup(ip, port) of IMulticastConfig it sets port properly to the filter. But when same thing I do in C#.Net (same code of VC++), it fails to sets different port to that filter. (every-time sets a new port. No compilation or run-time error). For C#.net, IMulticastConfig is written using IMulticastConfig of DirectX 9.0 of VC++. Following is my interface, using System.Runtime.InteropServices; [ComImport, System.Security.SuppressUnmanagedCodeSecurity, Guid("1CB42CC8-D32C-4f73-9267-C114DA470378"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IMulticastConfig { [PreserveSig] int SetNetworkInterface([In] ulong ulNIC); [PreserveSig] int GetNetworkInterface([Out] ulong pNIC); [PreserveSig] int SetMulticastGroup([In] ulong ulIP, [In] ushort usPort); [PreserveSig] int GetMulticastGroup([Out] ulong pIP, [Out] ushort pPort); } My code is, m_MulticastRcv] = Func.AddFilterByName(this.m_GraphBuilder, FilterCategory.LegacyAmFilterCategory, cNetworkInputFilterName); if (m_MulticastRcv == null) throw new Exception(); IMulticastConfig Inetwork = (IMulticastConfig)m_MulticastRcv; m_hResult = Inetwork.SetMulticastGroup(InetAddress("234.1.1.1"), (ushort)System.Net.IPAddress.HostToNetworkOrder((ushort)1234)); DsError.ThrowExceptionForHR(m_hResult); m_hResult = Inetwork.SetNetworkInterface(InetAddress("192.168.2.112")); DsError.ThrowExceptionForHR(m_hResult); Thanks & Regards, Aniket A. Salunkhe

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups