aclass := aobject.ClassType;
ClassTypeInfo := aclass.ClassInfo;
ClassTypeData := GetTypeData(ClassTypeInfo);
Proplist := Nil;
FrmProgress.Gauge1.Progress := FrmProgress.Gauge1.Progress + 1;
Try
GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
getpropinfos(aclass.classinfo, proplist);
For J := 0 To ClassTypeData.PropCount - 1 Do
Begin
Tk := PropList[J]^.PropType^.Kind;
If Tk = tkMethod Then
continue;
{ÏÂÃæÊÇдÈëÊôÐÔÊýÖµ}
Case tk Of
tklstring, tkString, tkWString:
Begin
{ TempInt := 1;
BBstr.Write(TempInt, sizeof(tempint));}
FieldStr := GetStrProp(aobject As aclass,
PropList[J]^.Name);
TempInt := Length(FieldStr);
Bbstr.Write(TempInt, SizeOf(TempInt)); //
Bbstr.Write(FieldStr[1], TempInt);
End;
tkinteger:
Begin
{ TempInt := 2;
BBstr.Write(TempInt, sizeof(tempint)); }
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
tkFloat:
Begin
Try
TempDou := GetFloatProp(aobject As aclass,
PropList[J]^.Name);
Except
TempDou := 0;
End;
{ TempInt := 3;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.Write(TempDou, sizeof(TempDou));
End;
tkClass:
Begin
{ TempInt := 5;
BBstr.Write(TempInt, sizeof(tempint));}
childobject := GetObjectProp(aobject As aclass,
PropList[j]^.Name);
apointer := childobject;
atcxbase := TCxList(apointer);
TempStr := Self.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen); //
TempStr := 'nil'; //Èç¹ûΪ¿Õ£¬ÔòÊäÈënil
If atcxbase <> Nil Then
TempStr := atcxbase.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen);
atcxbase.WriteFieldValue(BBstr);
End;
tkEnumeration:
Begin
TempStr := GetEnumProp(aobject As aclass,
PropList[j]^.Name);
len := length(TempStr) + 1;
{ TempInt := 4;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.write(len, sizeof(integer));
bbstr.Write(TempStr, len);
End;
tkSet:
Begin
{ TempInt := 6;
BBstr.Write(TempInt, sizeof(tempint));}
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
End; //end case
End; //end for
Finally
FreeMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
End;
ClassTypeInfo := aclass.ClassInfo;
ClassTypeData := GetTypeData(ClassTypeInfo);
Proplist := Nil;
FrmProgress.Gauge1.Progress := FrmProgress.Gauge1.Progress + 1;
Try
GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
getpropinfos(aclass.classinfo, proplist);
For J := 0 To ClassTypeData.PropCount - 1 Do
Begin
Tk := PropList[J]^.PropType^.Kind;
If Tk = tkMethod Then
continue;
{ÏÂÃæÊÇдÈëÊôÐÔÊýÖµ}
Case tk Of
tklstring, tkString, tkWString:
Begin
{ TempInt := 1;
BBstr.Write(TempInt, sizeof(tempint));}
FieldStr := GetStrProp(aobject As aclass,
PropList[J]^.Name);
TempInt := Length(FieldStr);
Bbstr.Write(TempInt, SizeOf(TempInt)); //
Bbstr.Write(FieldStr[1], TempInt);
End;
tkinteger:
Begin
{ TempInt := 2;
BBstr.Write(TempInt, sizeof(tempint)); }
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
tkFloat:
Begin
Try
TempDou := GetFloatProp(aobject As aclass,
PropList[J]^.Name);
Except
TempDou := 0;
End;
{ TempInt := 3;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.Write(TempDou, sizeof(TempDou));
End;
tkClass:
Begin
{ TempInt := 5;
BBstr.Write(TempInt, sizeof(tempint));}
childobject := GetObjectProp(aobject As aclass,
PropList[j]^.Name);
apointer := childobject;
atcxbase := TCxList(apointer);
TempStr := Self.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen); //
TempStr := 'nil'; //Èç¹ûΪ¿Õ£¬ÔòÊäÈënil
If atcxbase <> Nil Then
TempStr := atcxbase.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen);
atcxbase.WriteFieldValue(BBstr);
End;
tkEnumeration:
Begin
TempStr := GetEnumProp(aobject As aclass,
PropList[j]^.Name);
len := length(TempStr) + 1;
{ TempInt := 4;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.write(len, sizeof(integer));
bbstr.Write(TempStr, len);
End;
tkSet:
Begin
{ TempInt := 6;
BBstr.Write(TempInt, sizeof(tempint));}
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
End; //end case
End; //end for
Finally
FreeMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
End;
解决方案 »
- delphi 64位系统的自动获取IP
- 怎样得到一个文件简化的路径名?
- 关于BroadcastSystemMessage?
- excel批量导入700条数据以上,报错:"out of memory while expanding memory stream"
- 如何实现类似Delphi的属性窗体似的窗体
- 如何让每个窗体都能显示在任务条上!!!
- sql 语句
- 没想到会有这种情况出现,打印出错了.
- 边个可话比我知,点样才可以运行delphi6中的NMTime例子,运行它需要咩条件
- Delphi中报错project index.EXE raised exception class emcideviceerro with message
- 【在线等待】关于组件问题,请高手指教
- 怎么接触系统锁定?
win98应用程序是共享区域的,2000以上是独立区域的。不知道和这个有没有关系。
GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
一次性分配内存太大,
98和2000的内存分配管理不一样