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;

解决方案 »

  1.   

    看不出有什么问题,除非你的 win2000 的内存为 64M以下,或 cpu 是 PII
      

  2.   

    呵,机器的配置都很好...内存在256M或更高.cpu在  1.7 G的...惨...
      

  3.   

    具体是什么原因不清楚。
    win98应用程序是共享区域的,2000以上是独立区域的。不知道和这个有没有关系。
      

  4.   

    这里
    GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
    一次性分配内存太大,
    98和2000的内存分配管理不一样
      

  5.   

    getmem在98下确实比2000要快很多好象是系统内存管理的问题。GETMEM并不推荐使用在DELPHI中。你可以试试new dispose 这一对。
      

  6.   

    可以发一份完整的代码给我吗,我对此很感兴趣 [email protected]