/** * \return Operation Result. 0 incase of no errors. Failure Error codes otherwise. * * This function will popup hardware selection dialog and gets the user selection of channels. * */ int CDIL_CAN_i_VIEW::ListHardwareInterfaces( HWND hParent, DWORD /*dwDriver*/, INTERFACE_HW* psInterfaces, int* pnSelList, int& nCount ) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); CWnd objMainWnd; objMainWnd.Attach(hParent); CHardwareListing HwList(psInterfaces, nCount, pnSelList, CAN, CHANNEL_ALLOWED,&objMainWnd); INT nRet = HwList.DoModal(); objMainWnd.Detach(); if ( nRet == IDOK) { nCount = HwList.nGetSelectedList(pnSelList); return 0; } else { return -1; } }
/** * \brief This function will popup hardware selection dialog and gets the user selection of channels. * \param[in] psInterfaces, is INTERFACE_HW structue * \param[out] pnSelList, contains channels selected array * \param[out] nCount, contains selected channel count * \return returns 0 if success, else -1 * \authors Arunkumar Karri * \date 11.07.2012 Created */ int ListHardwareInterfaces(HWND hParent, INTERFACE_HW* psInterfaces, int* pnSelList, int& nCount, PSCONTROLLER_DETAILS InitData) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); CWnd objMainWnd; objMainWnd.Attach(hParent); IChangeRegisters* pAdvancedSettings = new CCANControllerConfigDlg(InitData[0].m_omStrBaudrate,InitData[0].m_nBTR0BTR1, nullptr); CHardwareListingCAN HwList(psInterfaces, nCount, pnSelList, CAN, CHANNEL_ALLOWED, &objMainWnd, InitData, pAdvancedSettings); INT nRet = HwList.DoModal(); objMainWnd.Detach(); if ( nRet == IDOK) { nCount = HwList.nGetSelectedList(pnSelList); return 0; } else { return -1; } }