// Todo: add your control notification handler code herecfile file ("11.txt", cfile: moderead); // create a file, link path, and read method char * pbuf; // define the character pointer to receive the document content, int Len = file. getlength (); // get the object Content Length pbuf = new char [Len + 1]; // pointer space file. read (pbuf, Len); // read the content pbuf [Len] = '\ 0'; // The last character file of the string. close (); // close the file // MessageBox (pbuf); int sum = 0; // sum int COUNT = 0; // data count for (INT I = 0; I <Len; I ++) {If (pbuf [I] = 'A' & pbuf [I + 1] = '+ ') // protocol format {count ++; cstring TMP; TMP + = pbuf [I + 2]; TMP + = pbuf [I + 3]; TMP + = pbuf [I + 4]; TMP + = pbuf [I + 5]; TMP + = pbuf [I + 6]; TMP + = pbuf [I + 7]; the 6 characters after reading the data in the format are int inttmp = atoi (TMP); the string is converted to an integer sum + = inttmp; // sum} cstring s; S. format ("% d", sum/count); // calculate the average value getdlgitem (idc_edit1)-> setwindowtext (s); // display