Thread: Can someone please tell me what class this function is returning

  1. #1
    Registered User
    Join Date
    Jan 2014
    Posts
    139

    Can someone please tell me what class this function is returning

    I have been over and over the msdn documentation and cannot find what class this is suppose to be.

    Below I have the interface IBaseFilter but I need to set some properties in the MicrosoftNetworkProvider. How can I do this?

    Code:
    CComPtr<IBaseFilter> pMicrosoftNetworkProvider = CreateFilterByName(L"Microsoft Network Provider", CLSID_BDANetworkProviders);

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    For COM, you don't try to figure out the class it returns. The right thing to do is check if the COM object implements the interface you want. The valid interfaces this object implements seem to be:

    IBaseFilter, IBDA_EthernetFilter, IBDA_NetworkProvider, IBDA_TIF_REGISTRATION, IBDA_IPV4Filter, IBDA_IPV6Filter, IFrequencyMap, IMPEG2_TIF_CONTROL, IScanningTuner, ITuner
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  3. #3
    Registered User
    Join Date
    Jan 2014
    Posts
    139
    thank you for the response.

    What I am trying to do is pass in the channel to the object.

    I found this example on how to do a ATSC tune request but that is using a ATSC provider (which doesnt work in windows 8.1) which was verified via graphedit

    Do you know how I can pass the channel to the object created from CreateFilterByName(L"Microsoft Network Provider"?
    Creating a Tune Request (C) (Windows)

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Well, it's been a long time since I've done COM in C++ but it should just be:

    Code:
    CComPtr<IBaseFilter> pMicrosoftNetworkProvider = CreateFilterByName(L"Microsoft Network Provider", CLSID_BDANetworkProviders);
    
    CComPtr<ITuner> pTuner;
    pMicrosoftNetworkProvider.QueryInterface(&pTuner); // or pMicrosoftNetworkProvider->QueryInterface(IID_PPV_ARGS(&pTuner));
    if (pTuner != NULL)
    {
     // Use the ITuner methods here
    }
    ITuner supports EnumTuningSpaces and put_TuneRequest which I guess are what you need to use? I haven't worked with ITuner before.

    Regardless, this illustrates the basic idea of COM - you get a COM object, use QueryInterface (either through the smart pointer wrapper or directly on the object) to ask it "Hey, object, can you do this?". If it returns a pointer, you can use that pointer to access the methods implemented by that interface.
    Last edited by Cat; 03-21-2014 at 08:26 AM.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 09-06-2011, 02:59 PM
  2. Recursion: base case returning 1, function returning 0
    By yougene in forum C Programming
    Replies: 5
    Last Post: 09-07-2007, 05:38 PM
  3. returning a class
    By apacz in forum C++ Programming
    Replies: 8
    Last Post: 06-30-2005, 06:53 PM
  4. Class returning a value
    By Magos in forum C++ Programming
    Replies: 6
    Last Post: 10-03-2002, 12:48 PM
  5. a class function returning a string
    By neandrake in forum C++ Programming
    Replies: 1
    Last Post: 03-17-2002, 04:57 PM