不要切换到MarkDown编辑器,直接选择
插入代码,选择编程语言类型。当然如果有人有强迫症要用Markdown的就无话可说了
void CClearDtc::ClearCode(const CString &strEcu) { adsMessageBox(STD_TEXT_INFORMATION, STD_TEXT_COMMING, DF_MB_NOBUTTON); CBinary binEcu = SetBinary(CB_ReadDtc, HexStrToBinary(strEcu), 4); CString strFilePath; strFilePath = "\\EcuFiles\\" + strEcu + ".ods"; CDataSheet openFile; openFile.Open(strFilePath); openFile.SetKey(binEcu); CString strEraserCmd = openFile.GetValue(STR_Menu, STR_EraserCmd); if (strEraserCmd.IsEmpty()) { adsMessageBox(STD_TEXT_INFORMATION, STD_TEXT_FUNC_NOT_SUPPORT, DF_MB_OK); return; } D_I32 iRet = adsMessageBox(STD_MENU_CLEAR_DTC, STD_TEXT_CONFIRMING, DF_MB_YESNO); if (DF_IDNO == iRet) { return; } iRet = adsMessageBox(STD_MENU_CLEAR_DTC, STD_TEXT_CLEAR_DTC, DF_MB_YESNO); if (DF_IDNO == iRet) { return; } CBinary binEraserCmd, binRequest, binResponse, binRecv; CString strRequest, strReqDelay, strResponse; //清码命令可能有多条 CGroup<CString>vctEraserCmd; Split(vctEraserCmd, strEraserCmd, "#"); for (D_I16 iCmd = 0; iCmd < vctEraserCmd.GetSize(); iCmd++) { binEraserCmd = SetBinary(binEcu, StrHextoBinary(vctEraserCmd[iCmd]), 1); openFile.SetKey(binEraserCmd); strRequest = openFile.GetValue(STR_Req, STR_Request); binRequest = HexStrToBinary(strRequest); strReqDelay = openFile.GetValue(STR_Req, STR_ReqDelay); strResponse = openFile.GetValue(STR_Rsp, STR_Response); binResponse = HexStrToBinary(strResponse); binRecv = SendCmd(binRequest); if (!strReqDelay.IsEmpty()) { Delay(StrToInt(strReqDelay)); } } adsMessageBox(STD_MENU_CLEAR_DTC, STD_TEXT_CLEARING_DTC, DF_MB_NOBUTTON); if (binRecv.IsEmpty())//只要有收到命令即可清码,不需要SID位+0x40 { adsMessageBox(STD_MENU_CLEAR_DTC, STD_TEXT_COMM_FAIL, DF_MB_OK); } else { adsMessageBox(STD_MENU_CLEAR_DTC, STD_TEXT_SUCCESS, DF_MB_OK); } }
欢迎到深圳程序员交流群交流:550846167