);
// 写入公式内容到内存
memcpy( pBuffer, pTextDefValFormula, wTextDefValFormulaLen );
pBuffer += CDField.DVLength;
// 解锁并释放公式占用的空间
OSUnlockObject(hTextDefValFormula);
OSMemFree(hTextDefValFormula);
// 域名部分,直接写入
memcpy( pBuffer, TextFieldName, CDField.NameLength );
pBuffer += CDField.NameLength;
// 域描述部分,直接写入
memcpy( pBuffer, TextDescription, CDField.DescLength );
pBuffer += CDField.DescLength;
// 保证整个域定义的长度为偶数
if ((pBuffer-pBufferStart) %2)
pBuffer++;
// 填写CDENDRECORD结构
CDEnd.Header.Length = (BYTE)ODSLength(_CDENDRECORD);
CDEnd.Header.Signature = SIG_CD_END;
CDEnd.Version = 0;
CDEnd.Signature = SIG_CD_FIELD;
ODSWriteMemory( (void far * far *)&pBuffer, _CDENDRECORD, (void far *) &CDEnd, 1 );