Y
yeyunfeng
Unregistered / Unconfirmed
GUEST, unregistred user!
CString EncodeCode128BByFont(CString text){ char *encodedtext = new char[text.GetLength()+4]; char *p_encodedtext = encodedtext; long checksum = 0; int k = 0; *p_encodedtext++ = 0x7C; checksum += 104; for(k=0;k<text.GetLength();k++) { *p_encodedtext++ = text.GetAt(k); checksum += (text.GetAt(k)-32)*(k+1); } checksum%=103; checksum+=32; *p_encodedtext++ = checksum; *p_encodedtext++ = 0x7E; *p_encodedtext = 0; CString ret = encodedtext; return ret;}