TBindings.Bind generated address error

Home Forums kbmMW TBindings.Bind generated address error

Viewing 2 reply threads
  • Author
    Posts
    • #55598
      TomYU
      Participant

      hi,

      run code, have a error.

      
      procedure TForm3.Button1Click(Sender: TObject);
      begin
      FBindings.UpdateEvent.Activate(False);
      FBindings.Clear;
      FBindings.Bind(DisplayDataSet, 'f1', ListView1, '#Text1'); // error.
      FBindings.Bind(DisplayDataSet, 'f2', ListView1, '#Text2');
      FBindings.Bind(DisplaydataSet, '@', ListView1, '@', [mwboTwoWay]);
      FBindings.Update;
      FBindings.UpdateEvent.Activate(True);
      end;
      
      

      best regards

      Tom YU.

    • #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.

    • #55602
      kimbomadsen
      Keymaster

      Hi,

      You were usually not supposed to deactivate the update event. Doing that release some internal resources which should only be released when the smart binding instance dies.

      However I can understand situations where one perhaps would like to pause the update event, why I have introduced a fix for next release.

      /Kim

Viewing 2 reply threads
  • You must be logged in to reply to this topic.