Пример #1
0
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;
}
Пример #2
0
HRESULT CMsgContainerLIN::GetFilterScheme(void* pvFilterApplied)
{
    HRESULT hResult = S_FALSE;
    SFILTERAPPLIED_LIN* psFilterLIN = (SFILTERAPPLIED_LIN*)pvFilterApplied;
    if (psFilterLIN != NULL)
    {
        //        if (psFilterLIN->bClone(m_sFilterLIN) == TRUE)
        if (psFilterLIN->bClone(m_sFilterLIN) == true)
        {
            //hResult = TRUE;
            hResult = S_OK;
        }
    }
    return hResult;
}
Пример #3
0
void CLogObjectLIN::GetFilterInfo(SFILTERAPPLIED_LIN& sFilterInfo) const
{
    sFilterInfo.bClone(m_sFilterApplied);
}