Jump to content


Photo

EInvalidPointer: NxVirtualGrid6


  • Please log in to reply
5 replies to this topic

#1 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 19 October 2017 - 07:39 PM

I just install latest version (nextsuite6_9-17) and after some RowChanged it happens a lot that I get this exception?

This is not happens directly so I don't know what to do.

Can you see why this is happening?

 

exception number   : 1
exception class    : EInvalidPointer
exception message  : Invalid pointer operation.

main thread ($148):
0040d50c +040 FinalPlayer.exe System             34459  +53 @DynArrayClear
0073ceee +082 FinalPlayer.exe NxVirtualGrid6       704   +7 InitShowingArray
0073d048 +008 FinalPlayer.exe NxVirtualGrid6       760   +1 TNxVirtualCellSource6.RowsChanged
0073dc0f +047 FinalPlayer.exe NxVirtualGrid6      1095   +3 TNextVirtualGrid6.RowsChanged
00969891 +2d1 FinalPlayer.exe CustomUnitControls  1048  +81 GlobalConnect
0088c19c +034 FinalPlayer.exe CustomContainer     1734   +2 DefaultConnect
0088c1c4 +010 FinalPlayer.exe CustomContainer     1740   +1 TfrmContainer.Connect
0091dec5 +0f9 FinalPlayer.exe DatabaseControl      225  +23 Available_CopyItemsToContainer
 

I fully remove the old package.

 

Maybe this one is the actually bug?

(I think FSelected = nil)

 

exception number   : 1
exception class    : EAccessViolation
exception message  : Access violation at address 00747B36 in module 'FinalPlayer.exe'. Read of address 00000000.

main thread ($1b88):
00747b36 +00e FinalPlayer.exe NxVirtualGrid6    778   +3 TNxVirtualCellSource6.SetSelected
00748bb3 +04f FinalPlayer.exe NxVirtualGrid6   1169   +3 TNextVirtualGrid6.SetSelected
00755035 +3a1 FinalPlayer.exe NxCustomGrid6    3293 +130 TNxCustomGrid6.SelectCell
0040edd4 +010 FinalPlayer.exe System          36327  +10 @IntfClear
00755851 +041 FinalPlayer.exe NxCustomGrid6    3630   +3 TNxCustomGrid6.SetSelectedRow
00993c73 +05f FinalPlayer.exe ExtendedMain     1070   +7 AdjustItemIndex
00896512 +086 FinalPlayer.exe CustomContainer  1471   +6 TfrmContainer.ProcessAvailable
 

[EDIT]

Fixed this on:

But is this a good solution?

 

procedure TNxVirtualCellSource6.SetSelected(const Index: Integer; const Value: Boolean);
var
  AValue: Boolean;
begin
  { Added: Eduard for Bugfix }
  if (not Assigned(FSelected)) then
    Exit;


  if Index > -1 then
  begin
    AValue := FSelected[Index];
    if AValue <> Value then
    begin
      FSelected[Index] := Value;
      if Value then Inc(FSelCount) else Dec(FSelCount);
      if FSelCount < 0 then FSelCount := 0;
    end;
  end;
end;

 

Regards,

Eduard.



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 October 2017 - 07:15 PM

Hi Eduard,

I'm not sure unfortunately. It will not hurt, but maybe problem is deeper.

Mini demo (or test project) can help.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 24 October 2017 - 04:58 AM

Hi Bojan,

 

I used a older version and had some own changes for the VirtualGrid added. Now removed all and update latest version and everything is working fine.

 

I removed Bugfix in 'SetSelected' and wait if there is something going wrong here. Maybe a bugreport is more clearly. Happens not al the time. Must wait.

 

Demo project is then not needed because I can not simple recreate this Bug.

 

Please change this one:

(Used this one over a year but forget to report)

function TNextVirtualGrid6.GetLastSelected: Integer;
var
  i: Integer;
begin
  i := LastVisibleRow;
  Result := 0; // -1 results in first item always stays selected
  while i > 0 do
  begin
    if Selectable.Selected[i] then
    begin
      Result := i;
      Break;
    end else Dec(i); // Dec must be here
  end;
end;

Regards,

Eduard.



#4 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 27 October 2017 - 09:40 AM

Hi Bojan,

 

Have or will you change this function?

 

function TNextVirtualGrid6.GetLastSelected: Integer;

(See above)

 

Regards,

Eduard.



#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 29 October 2017 - 12:42 PM

Hi,

I will need to test it more. Not sure how GetLastSelected will behave in NextGrid too.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#6 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 29 October 2017 - 01:14 PM

I was thinking this is only for the Virtualgrid.

If you don't change original code the multi select Virtualgrid is not working properly. 






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users