TomYU

Forum Replies Created

Viewing 48 reply threads
  • Author
    Posts
    • #57657
      TomYU
      Participant

      Which line of code specifically caused the problem?

    • #57619
      TomYU
      Participant

      这是我以前写的,参考下。

      https://www.cnblogs.com/kinglandsoft/p/16418247.html

    • #57617
      TomYU
      Participant

      Close Range check

    • #57584
      TomYU
      Participant

      …..

    • #57533
      TomYU
      Participant

      This problem does exist and we look forward to resolving it as soon as possible. Additionally, I have encountered issues with calling the Activate method.
      When switching to Activate, Activate=True and the schedule is not executed.

    • #57527
      TomYU
      Participant

      kbmMW Version: 5.23.00

    • #57404
      TomYU
      Participant

      Let’s see if there’s any latest news, unfortunately it’s still not there.

    • #56498
      TomYU
      Participant

      ……

    • #56429
      TomYU
      Participant

      how to test?

      Is Delphi 11 or Delphi 11.1?

    • #56416
      TomYU
      Participant

      Default compilation variables used:
      {$DEFINE KBMMW_SUPPORT_FASTMRWSLOCK} // If to use native very fast Multiple Reader Exclusive Writer lock.

    • #56415
      TomYU
      Participant

      The pause method does not work as expected on the Android platform:

      procedure TkbmMWCustomThread.Pause;

    • #56414
      TomYU
      Participant

      As a new development, I found that the code implemented in this way can execute normally on android platform.

      procedure TForm1.Button2Click(Sender: TObject);
      begin
      rs:=TkbmMWPooledDatasetRefreshScheduler.Create(Self);
      rs.StopScheduling; //not frozen when TkbmMWPooledDatasetRefreshScheduler.Owner<>nil.
      rs.Free;
      rs:=nil;
      end;

    • #56413
      TomYU
      Participant

      When the application is closed, kbmMWClientConnectionPool1 will be released.

      and kbmMWClientConnectionPool1 will execute the following methods:
      FRefreshScheduler. StopScheduling;
      On the Android platform, this line of code is frozen and will not continue.

      So the application can’t exit normally!

      fixed code:

      procedure TkbmMWPooledDatasetRefreshScheduler.StopScheduling;
      begin
      if FThread.IsStarted then//add by Tom YU
      FThread.Pause;
      end;

      I don’t know if this correction is correct, but my application can be closed normally.

      best regards

      Tom YU.

       

    • #56412
      TomYU
      Participant

      I found the cause of this problem, but I don’t know how to modify the code.

      Problems caused by kbmMWGetCurrentThreadID function on Android platform.

      This function generates an exception when the boundary check compilation option is turned on.

      I recorded more details here:

      https://www.cnblogs.com/kinglandsoft/p/16094998.html

    • #56411
      TomYU
      Participant

      hi,

      I did this just to redisplay the problem.
      When the application is closed, because this component cannot be released normally, the application cannot exit normally. When the application is restarted, the application is stuck.
      This is a problem on the Android platform.

      best regards

      Tom YU.

       

    • #55972
      TomYU
      Participant

      Has this problem been solved?

    • #55825
      TomYU
      Participant

      A ClientQuery has F1,F2,F3 fields, F1 is primary key,when i modify F2, I want to generate SQL like this: update testtable set (f1,f2) values (‘aaa’,’bbb’) where f1=xxx.

       

    • #55773
      TomYU
      Participant

      hi, kim

      In fact, this problem has existed since 5.10.10, and we look forward to official corrections.

      best regards

      Tom YU.

       

    • #55771
      TomYU
      Participant

      fixed code:

      procedure TkbmMWBindingDataSourceNavigator.SetValue(const AName:string; const AValue:TValue);
      var
      fld:TField;
      begin
      if IsValid then
      begin
      fld:=FDataSource.Dataset.FindField(AName);
      if fld<>nil then
      begin
      if not (FDataSource.Dataset.State in [dsEdit,dsInsert]) then //+++++
      FDataSource.DataSet.Edit;//+++++
      fld.AsVariant:=TkbmMWRTTI.ConvertValue2Variant(AValue,nil);
      FDataSource.DataSet.Post;//+++++
      end;
      end;
      end;

    • #55653
      TomYU
      Participant

      thanks!

       

    • #55622
      TomYU
      Participant

      fixed code:

      
      class function TkbmMWPlatformMarshal.Memory2Int16(const AMemory:PByte; const ALittleEndian:boolean):smallint;
      type
      TShortBytes = packed record
      case integer of
      1: (short: smallint);
      2: (b:array[1..2] of byte);
      end;
      PShortBytes = ^TShortBytes;
      PShort=^smallint;
      var
      t:TShortBytes;
      begin
      {$IFDEF KBMMW_BIG_ENDIAN}
      if ALittleEndian then
      {$ELSE}
      if not ALittleEndian then
      {$ENDIF}
      begin
      t.b[1]:=PShortBytes(AMemory).b[2];
      t.b[2]:=PShortBytes(AMemory).b[1];
      Result:=t.short;
      end
      else
      Result:=PShort(AMemory)^;
      end;
      
      
    • #55621
      TomYU
      Participant

      hi,

      kbmMW 5.15 fixed!

      thanks!

      best regards.

      Tom yu

    • #55606
      TomYU
      Participant

      FMX ListView only displays the content of the first bound field, the others are not displayed.

       

    • #55599
      TomYU
      Participant
      
      procedure TForm3.Button1Click(Sender: TObject);
      begin
      FBindings := TkbmMWBindings.Create;
      FBindings.Bind(DisplayDataSet, 'f1', ListView1, '#Text1'); // error.
      FBindings.Bind(DisplayDataSet, 'f2', ListView1, '#Text2');
      FBindings.Bind(DisplaydataSet, '@', ListView1, '@', [mwboTwoWay]);
      FBindings.UpdateEvent.Activate(False);
      FBindings.Clear; //An error occurred
      end;
      
      

      Writing the code like this reproduced this error.

    • #55597
      TomYU
      Participant

      This problem is real in my actual project, for this reason I cannot upgrade to kbmMW 5.14.

    • #55594
      TomYU
      Participant

       

      procedure TListDialogFrame.PrepareView;
      begin
      if DisplayDataSet <> nil then
      begin
          ListViewSearchBox(ListView1).Text:='';
          FBindings.Clear;//*******************
          if KeyFieldName <> '' then
             FBindings.Bind(DisplayDataSet, KeyFieldName, ListView1, '');
          FBindings.Bind(DisplayDataSet,DisplayFieldName,ListView1,'#Caption');
          FBindings.Bind(DisplaydataSet,'@',ListView1,'@',[mwboTwoWay]); //双向绑定.位置同步.
          FBindings.Update;
          FBindings.UpdateEvent.Activate(True);
      end
      else
      begin
          FBindings.Clear;//*****************
          FillListFromDisplayStringList;
      end;
      end;
      
      • This reply was modified 5 years, 6 months ago by TomYU.
      • This reply was modified 5 years, 6 months ago by TomYU.
    • #55578
      TomYU
      Participant

      Because of this issue, I cannot upgrade to kbmMW 5.14!

    • #55395
      TomYU
      Participant

      when will release an update of kbmMW?

    • #55272
      TomYU
      Participant

      What compile error message is displayed?

      Is it “[DCC Error] kbmMWGlobal.pas(3560): E2003 Undeclared identifier: ‘TkbmMWStringList'”?

      I also encountered a similar problem.

       

      • This reply was modified 5 years, 9 months ago by TomYU.
    • #55250
      TomYU
      Participant

      ki,kim

      delete this topic.

       

    • #55249
      TomYU
      Participant

      I had to change Queue to Synchronize to ensure that my application can run normally.

    • #55216
      TomYU
      Participant

      Hi,

      I tried and still did not solve the problem, I sent an email to you, pay attention to check.

      best regards

      Tom YU.

    • #55207
      TomYU
      Participant

      hi,

      I’m sorry,I made a mistake!

      best regards

      Tom YU.

    • #55206
      TomYU
      Participant

      hi,

      I found set kbmMWTCPIPIndyClientTransport1.VerifyTransfer and kbmMWTCPIPIndyServerTransport1.VerifyTransfer =True, Client can connect server.

      if set VerifyTransfer=False for server and client, Client can’t connect server.

      best regards

      TomYU.

    • #55204
      TomYU
      Participant

      hi,kim

      5.13 fixed! Thank you.

      Best regards

      TomYU.

    • #55203
      TomYU
      Participant

      hi,kim

      5.13 not fixed!

      Best regards

      TomYU.

    • #55202
      TomYU
      Participant

      hi,kim

      5.13 fixed!

      Thank you.

      Best regards

      TomYU.

    • #55201
      TomYU
      Participant

      hi,kim

      5.13 fixed!

      thank you!

      best regards

      TomYU

    • #55190
      TomYU
      Participant

      Code written like the following will not trigger WhenException.

      Scheduler.Run(Task1)
      .WhenException(procedure(const AException:Exception)
      begin
      ShowMessage(AException.Message);
      end)
      .Activate;

    • #55175
      TomYU
      Participant

      hi,

      Thank you for your reply and agree with you.

      If this method is added to kbmMWClientQuery, it will let me not use the helper class.

      best regards.

      Tom yu.

       

    • #55170
      TomYU
      Participant

      This is the helper class I wrote to solve the above problem:

      function TkbmMWClientQueryHelper.IsModified: Boolean;
      var
      i: TkbmNativeInt;
      j: TkbmNativeInt;
      pRec, pOrigRec, pOldRec: PkbmRecord;
      aRecords: TkbmList;
      st: TUpdateStatus;
      aOldV, aNewV: Variant;
      begin
      if Self.State in [dsInsert, dsEdit] then
      Self.Post;
      Result := False;
      with Self do
      begin
      aRecords := Common.Records;
      for i := 0 to aRecords.Count – 1 do
      begin
      pRec := PkbmRecord(aRecords.Items[i]);
      if pRec = nil then
      begin
      Continue;
      end;
      // Find oldest version.
      pOrigRec := pRec;
      while pOrigRec^.PrevRecordVersion <> nil do
      begin
      pOrigRec := pOrigRec^.PrevRecordVersion;
      end;

      // Check what status to react on.
      if pRec^.UpdateStatus = usDeleted then
      begin
      // Dont resolve inserts that were deleted again.
      if pOrigRec^.UpdateStatus = usInserted then
      st := usUnmodified
      else
      st := usDeleted;
      end
      else if pOrigRec^.UpdateStatus = usInserted then
      st := usInserted
      else
      st := pRec^.UpdateStatus;
      pOldRec := OverrideActiveRecordBuffer;
      try
      if st = usModified then
      begin
      OverrideActiveRecordBuffer := pRec; // 指向修改后的数据
      for j := 0 to FieldCount – 1 do
      begin
      OverrideActiveRecordBuffer := pRec; // 指向修改后的数据
      aNewV := FieldByName(Fields[j].FieldName).Value;
      OverrideActiveRecordBuffer := pOrigRec; // 指向修改前的数据
      aOldV := FieldByName(Fields[j].FieldName).Value;
      if aNewV <> aOldV then
      begin
      Result := True;
      Break;
      end;
      end;
      end
      else if st = usInserted then
      begin
      Result := True;
      end
      else if st = usDeleted then
      begin
      Result := True;
      end
      else if pRec.UpdateStatus = usUnmodified then
      begin

      end;
      finally
      OverrideActiveRecordBuffer := pOldRec;
      end;

      if Result then
      Break;
      end;
      end;
      end;

    • #54995
      TomYU
      Participant

      For such a complicated SQL, it is better to write a method on the server side.

    • #54960
      TomYU
      Participant

      Currently I only use listView binding with ClientQuery.

    • #54879
      TomYU
      Participant

      Hi,

      Thanks!
      5.12 fixed is OK!

    • #54788
      TomYU
      Participant

      I bind the keyfield value to a Text object in ListviewItem,
      Now I call the DataSet.Locate method to synchronize the current position of the Dataset.

       

    • #54785
      TomYU
      Participant

      This problem affects the TkbmMWBindings.Update method.
      The TkbmMWBindings.Update method will enter an infinite loop when the UpdateNonSync method generates an exception.

    • #54779
      TomYU
      Participant

      Do you call the Stop method in the thread executed by the Scheduler?

      If so, that is the reason.

    • #54769
      TomYU
      Participant

      hi,

      “In addition, when the Listview is bound to the clientquery, my users can feel the efficiency is very low on the android platform, Is there a way to improve the efficiency?”

      This problem was caused by rebinding.
      I created a field for ClientQuery during the design period and bound it once during the run time to solve the problem of slow display.

      best regards
      Tom yu.

    • #54749
      TomYU
      Participant

      I bind a clientquery, and then when I reopen the clientquery, I must clear the binding before opening, and then rebind after opening.

      How can smartbind better support data reopening? Once bound, Smartbind can adapt to the reopening of the clientquery.

      • This reply was modified 6 years, 4 months ago by TomYU.
      • This reply was modified 6 years, 4 months ago by TomYU.
    • #56529
      TomYU
      Participant

      This content is meaningless. Kbmmw is right.

    • #56527
      TomYU
      Participant

      Sorry,this is error.

      Define in unit System:

      {$IFDEF POSIX}
      TThreadID = NativeUInt;
      {$ENDIF}

      Help file:

      Defines a platform-dependent unsigned integer.

      NativeUInt represents a subset of the natural numbers. The range of NativeUInt depends on the current platform. On 32-bit platforms, NativeUInt is equivalent to the Cardinal type. On 64-bit platforms, NativeUInt is equivalent to the UInt64 type.

      The size of NativeUInt is equivalent to the size of the pointer on the current platform.

      function kbmMWGetCurrentThreadID:TkbmNativeUInt;
      should change to :
      function kbmMWGetCurrentThreadID:TThreadID ;

    • #56512
      TomYU
      Participant

      it’s work fine.

       

    • #56423
      TomYU
      Participant

      I’m not sure. I just want to test FLock.BeginWrite work as expected?

    • #55613
      TomYU
      Participant

      Can it display the file name requested by the client?

    • #54776
      TomYU
      Participant

      After using mwafoNevera or mwafoOncer, I do not need to rebind, but when ClientQuery is opened, Listview and data set are often displayed out of sync, even though I call the Refresh method.
      This forced me to change back to the original way.

    • #54775
      TomYU
      Participant

      I have some questions about smartbind:

      1.Smarbind does not work properly on the Android platform, but works normally on Windows. When ClientQuery.AutoFieldDefsOnOpen = mwafoOnce.
      I think mwafoOnce has bug on android platform.
      An error message : the field does not have a dataset.

      2.I had to call Refresh twice for Listview to display the contents of the dataset correctly.
      qOrderItem is a TkbmMWClientQuery and qOrderItem .AutoFieldDefsOnOpen =mwafoNever

      procedure TForm1.BindOrderItem;
      begin
      qOrderItem .AutoFieldDefsOnOpen :=mwafoNever;
      if NavigatorOrderItem=nil then
      begin
      FBindOrderItem.Bind(qOrderItem, ‘FGoodsCode’, ListView1, ‘#fgoodscode’);
      … NavigatorOrderItem:=FBindOrderItem.Bind(qOrderItem, ‘@’, ListView1, ‘@’, [mwboTwoWay]);
      end;
      NavigatorOrderItem.Navigator.Refresh;
      NavigatorOrderItem.Navigator.Refresh;//+++++++++++++

      end;

      3.In the process of repeatedly opening the dataset when clientquery .AutoFieldDefsOnOpen :=mwafoNever, occasionally an error message is generated: the field does not have a dataset. This is caused when smartbind calls the Update method.

    • #54767
      TomYU
      Participant

      hi,

      This is definitely good news for me.

      I have used smartbind in the actual project. If I can see the improvement of the above problem as soon as possible, it is a very grateful event for me.

      I have already felt the perfection of smartbind. Smartbind is a technology that must be used in the development projects. I look forward to smartbind being more perfect.

      In order to bind the reopened clientquery, I have to write a lot of code because my clientquery is on the datamodule and the binding object is on the form. In the end, it looks like the form and datamodule Still tightly coupled together.

      In addition, when the Listview is bound to the clientquery, my users can feel the efficiency is very low on the android platform, Is there a way to improve the efficiency?

      best regards
      Tom yu.

    • #54590
      TomYU
      Participant

      How do you modify it?

Viewing 48 reply threads