locked
LNK2001 error appear when use DeviceTopology API RRS feed

  • Question

  • Dear all:


    I modify WinAudio sample code and try to add  DeviceTopology api to select input/output device ....

    And I find sample form SDK...

     

    HRESULT GetHardwareDeviceTopology(
              IMMDevice  *pEndptDev,
              IDeviceTopology **ppDevTopo
            )

    {

    ..........

    ..........

        hr = pEndptDev->Activate(
                          IID_IDeviceTopology, CLSCTX_ALL,
                          NULL, (void**)&pDevTopoEndpt);

    ..........

    ..........

        hr = pConnHWDev->QueryInterface(
                           IID_IPart, (void**)&pPartConn);

    ..........

    ..........

    }
    when I build  the code link error will appear ...

     

    erro LNK2001: unresolved external symbol _IID_IPart
      error LNK2001: unresolved external symbol _IID_IDeviceTopology

     

    I already include <Devicetopology.h>

     

    Did I still miss some things ???

    Thinks ~~ ^.^;;

    BR,

    Tuesday, April 3, 2007 9:32 AM

Answers

  • Try using __uuidof(IDeviceTopology) and __uuidof(IPart) instead of the IID_* constants.

     

    ----------------------------------------------------------------------------
     Mike Wasson, SDK Documentation
     This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2007 Microsoft Corporation. All rights reserved.

     

    Wednesday, April 4, 2007 6:04 PM