我需要构建一个应用程序来配置一些解调器参数(如符号率、调制类型等),我通过 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 驱动程序是否良好。
任何将我指向正确方向的想法都值得赞赏。