USAGEMODE HRESULT Filter_ShowConfigDlg(void* pExistingFilter, const void* psMsgEntry, ETYPE_BUS eType, UINT nHardware, CWnd* pParent) { //Place this code at the beginning of the export function. //Save previous resource handle and switch to current one. HINSTANCE hInst = AfxGetResourceHandle(); AfxSetResourceHandle(FilterDLL.hResource); HRESULT hResult = S_FALSE; switch (eType) { case CAN: { if (pExistingFilter != NULL) { SFILTERAPPLIED_CAN* pAppliedFilterCan = (SFILTERAPPLIED_CAN*)pExistingFilter; SFILTERAPPLIED_CAN sTempObj; sTempObj.bClone(*pAppliedFilterCan); CFilterConfigDlg omDlg(&sTempObj, (SMSGENTRY *)psMsgEntry, nHardware, pParent); if (omDlg.DoModal() == IDOK) { pAppliedFilterCan->bClone(sTempObj); hResult = S_OK; } //delete omDlg; } } break; case LIN: if (pExistingFilter != NULL) { SFILTERAPPLIED_LIN* pAppliedFilterLin = (SFILTERAPPLIED_LIN*)pExistingFilter; SFILTERAPPLIED_LIN sTempObj; sTempObj.bClone(*pAppliedFilterLin); CFilterConfigDlg omDlg(&sTempObj,(ClusterConfig *) psMsgEntry, nHardware, pParent); if (omDlg.DoModal() == IDOK) { pAppliedFilterLin->bClone(sTempObj); hResult = S_OK; } //delete omDlg; } break; default: { } break; } //Place this at the end of the export function. //switch back to previous resource handle. AfxSetResourceHandle(hInst); return hResult; }
/******************************************************************************* Function Name : dShowReplayConfigurationDlg Input(s) : - Output : DWORD - Returns the dialog DOModal return value Functionality : To show replay configuration dialog Member of : CReplayManager Author(s) : Raja N Date Created : 16.7.2005 Modifications : *******************************************************************************/ DWORD CReplayManager::dShowReplayConfigurationDlg(const SFILTERAPPLIED_CAN* psFilterConfigured) { DWORD dwResult; // Copy Replay Manager CReplayManager ouTemp; vCopyReplayManager( ouTemp, *this ); // Show configuration dialog CReplayFileConfigDlg omDlg( ouTemp, psFilterConfigured); dwResult = (DWORD)omDlg.DoModal(); if( dwResult == IDOK ) { // Copy the user selection vCopyReplayManager( *this, ouTemp ); } // Return the result return dwResult; }
USAGEMODE HRESULT Filter_ShowSelDlg(CWnd* pParent, CMainEntryList* podMainSubList) { //Place this code at the beginning of the export function. //Save previous resource handle and switch to current one. HINSTANCE hInst = AfxGetResourceHandle(); AfxSetResourceHandle(FilterDLL.hResource); SGUIPARAMS sGuiParams; /* Update GUI related information */ /* 1. Title Name, Main entry combo box name, Name of the list controls */ strcpy_s(sGuiParams.m_acTitleName, MAX_PATH, _("Filter Selection Dialog")); strcpy_s(sGuiParams.m_acMainListName, MAX_PATH, _("Bus")); strcpy_s(sGuiParams.m_acUnSelListName, MAX_PATH, _("Configured Filters")); strcpy_s(sGuiParams.m_acSelListName, MAX_PATH, _("Selected Filters")); /* Whether to combine main entry Id with sub entry name or not*/ sGuiParams.m_bCombine = FALSE; /* What image to be loaded */ sGuiParams.m_pomImageList = new CImageList; sGuiParams.m_pomImageList->Create(IDB_BMP_FILTER, 16, 1, defCOLOR_WHITE); //Icon index to unselected list sGuiParams.m_unUnSelIconIndex = 2; //Icon index to selected list sGuiParams.m_unSelIconIndex = 2; CMainSubListDlg omDlg(pParent, podMainSubList, sGuiParams); INT_PTR nReturn = omDlg.DoModal(); //delete the created list sGuiParams.m_pomImageList->DeleteImageList(); delete sGuiParams.m_pomImageList; //Place this at the end of the export function. //switch back to previous resource handle. AfxSetResourceHandle(hInst); return (HRESULT)nReturn; }