我需要构建一个应用程序来配置一些解调器参数(如符号率,调制类型等),我通过Microsoft BDA架构做了这些事情;但是,这是我的代码如下:
CComPtr <IBDA_Topology> pITopology;
CComPtr <IBDA_AutoDemodulate> m_pIAutoDemod;
CComPtr <IBDA_DigitalDemodulator> m_pIDigiDemod;
hr = m_pTunerDevice->QueryInterface(IID_IBDA_Topology,
reinterpret_cast<void**>(&pITopology) );
ULONG nNodesTypeNum = 0;
ULONG NodesType[10];
hr = pITopology->GetNodeTypes(&nNodesTypeNum, 10, NodesType);
CComPtr <IUnknown> pIUknow;
// NodesType[1] is the Demod node
hr = pITopology->GetControlNode(0, 1, NodesType[1], &pIUknow);
ULONG nInterfacesNum = 0;
GUID InterfacesGUID[10];
// After this call, we sure that InerfacesGUID[0] == IID_IBDA_AutoDemodulate
// and InerfacesGUID[1] == IID_IBDA_DigitalDemodulator
hr = pITopology->GetNodeInterfaces(NodesType[1], &nInterfacesNum, 10,
InerfacesGUID);
// Call this success
hr = pIUknow->QueryInterface(IID_IBDA_DigitalDemodulator, (void
**)&m_pIDigiDemod);
ModulationType type = BDA_MOD_NOT_DEFINED;
hr = m_pIDigiDemod->get_ModulationType(&type);//failed here
我可以毫无问题地获得接口对象;但是当我调用任何方法(获得调制类型,获得符号率)时,它总是返回E_HANDLE;我也检查我的BDA驱动程序是好的。
任何指出我正确方向的想法都会受到赞赏。