TAdvStringGrid: Stack overflow FilterEdit DTOR


I have an AdvStringGrid instance in one form and want to be able to easily filter contents of both. So I enabled FilterEdit in some fixed row and the filtering itself is working fine. The problem is that I need Drag&Drop functionality as well and whenever I activate the setting OleDropTarget and use the filter then, the application crashes with a stack overflow. The details of that overflow depend on what I have done, either just clicked into the filter cells, without inputting any filter data, or if I input any filter data.

This is reproducible for my complex grid and for a standard one: I only need to add a grid, activate filter edit and enable OleDropTarget and the problem occurs. Disabling OleDropTarget and the problem doesn't occur, regardless if I input any values in the filter cells or not. It doesn't happen for OleDropSource as well.

Do you have any idea on what the problem is and how I can work around it? I need both, filtering and DnD functionality. Thanks!

Thanks for reporting. We could trace & fix this strange issue. The next update will address this.

Glad to here that, thanks. Do you have any estimation for that release? "My products" is saying "Tuesday, October 11, 2016"... The problem I have is that my current project is relying on the DnD and filtering behaviour and I either can't release until I get the fix or need to change the GUI and usability quite heavily to get at least something usable working.

Don't want to apply pressure, just need to tell my manager and customer a time frame. Rebuilding the GUI wouldn't be worth it for just two weeks of waiting.

I have another stack overflow which might be related, so please test this situation as well. Put an AdvStringGrid in a form and change it using the following lines of code:

AdvStringGrid3->DragDropSettings->OleDropTarget = true;
AdvStringGrid3->ScrollBarAlways = saBoth;

With all three lines enabled I get the following stack overflow, with only one of those disabled the error is resolved. But of course I need all three of those... :-)

This problem is also fixed.

I have updated to the current release yesterday and still get a stack overflow when using filters. It occurs whenever I use filters to filter some rows and simply close the application afterwards in AdvStringGrid::RemoveLastFilter.

Debugger Exception Notification
Project raw.exe raised exception class $C00000FD with message 'stack overflow at 0x0046bea8'.
Break   Continue   Help

I retested demos 22 and 80 that have filtering but these work without issues. So, what is different in your app?

I use Drag&Drop and that is the problem again: If OleDropTarget is enabled at the time the DTOR of my form is called, I get a stack overflow. If I disable OleDropTarget in the DTOR, the problem doesn't occur anymore. In the following screenshot you can see that TGridDropTarget seems to be created in RemoveLastFilter somehow during deconstruction and that seems to overflow. The interesting thing is that I can trigger the problem without doing any DnD or filtering at all, I just need to click into the filter edit and close the application, without any input in the filter edit or hitting ENTER or else. I even have two grids with essentially the same settings and the problem appears on both individually in exactly the same way.

The problem is that I couldn't reproduce this behaviour in a stripped down project and I'm pretty sure that I tried all properties set like in my project where the problem occurs. But in the test project there's no stack overflow in the DTOR for some reason. I hope my description is of any help anyway...

__fastcall TFmSendDetails::~TFmSendDetails()
	AsgRecipientsAvailable->DragDropSettings->OleDropTarget = false;
	AsgRecipientsSelected ->DragDropSettings->OleDropTarget = false;

I enabled drag & drop in sample 22 & 80 but I could also not see a problem with this.

Please provide some sample source project with which this can be reproduced here so we can investigate.

The following provides an example project where I at least managed to get another stack overflow in USER32.SetPropW like reported before already, but not the one I reported last. But maybe both are related.


I added this form to a new project due to the absence of a project file and I tried all kinds of things on this form file but I couldn't see any error. Can you please provide clear steps to be able to reproduce this issue? Also, do you use the latest version of the grid?

Sorry, should haven mentioned that before, the project file is in one of the sub folders of "build". The archive provided is complete, the only thing that should differ from your system is the paths to TMS Component Pack, which I don't install globally, but have redirected to a SVN repo.

Yes, I use the latest version of the pack from this week and I don't have any other version installed or available in my SVN repo. The paths in use even contain the version number.

Compile and start the app, input some arbitrary filter subject into the edit 0:1, press ENTER. Close the app and it crashes in my case.

I've attached another archive with only the one grid to test left.


The exact path is:

build\RAD 10.1\apps\RecipientSearchTests\RecipientSearchTests

The exact path is:

build\RAD 10.1\apps\RecipientSearchTests\RecipientSearchTests.cbproj

We could now trace & fix the issue. The next update will address this.

Yet another exception: I filter in one of my two grids, use Drag&Drop to move one of the result rows to the other grid, close the application and "Invalid pointer operation" is thrown like in the following screenshot. Can not reproduce this exact exception currently in my test app, because in that USER32.SetPropW overflows when I do the exact same steps.

Am I the only one using FilterEdits and DnD? Or am I doing things that wrong that I regularly break things? This is disappointing, disabling DnD in the DTOR doesn't even work for this one anymore.

I cannot reproduce this.
Was retested with 2 grids, filtering on top grid, drag & drop of rows to 2nd grid & close applications but no error can be seen here.

procedure TForm1.FormCreate(Sender: TObject);
  advstringgrid1.SaveFixedCells := false;
  advstringgrid1.FilterEdit.Enabled := true;

  advstringgrid1.Options :=  advstringgrid1.Options + [goRowSelect];
  advstringgrid2.Options :=  advstringgrid2.Options + [goEditing];
  advstringgrid1.DragDropSettings.OleDropSource := true;
  advstringgrid2.DragDropSettings.OleDropTarget := true;