Closed thefasquelle closed 1 month ago
Thanks @thefasquelle for the kind words and the feedback!
Your approach is probably what I would also do. The alternative would be to restore the correct IUnknown:Release
and IUnknown:AddRef
pointers in the virtual function table for the DataObject
interface while also correcting the reference count.
Will try to do some work on this class in the next few weeks.
The biggest problem with this class is that the callback does not work when End
is called while code is running - this might be something that has no solution but will see.
The biggest problem with this class is that the callback does not work when End is called while code is running - this might be something that has no solution but will see.
yeah, the main reason I used this callback is for unhandled errors where user press the End button. Sadly it does not work And I would be surprised you can do it without hacking into the VBA runtime itself (like vbWatchdog does). At least it works when using the stop button, which happens a lot when your users are also developers !
Thanks for the suggestion! Added a Cancel
method.
Hi, thank you for this awesome class ! I needed a way to cancel the callback, and I think it could benefit other people too.
I did it by adding an
Enabled
property that is set to True inInit
and checked inDataObject_Clear
I also added a
Cancel
sub that set Enabled to False but that's not really necessary.Maybe there is a better way that actually cancel the callback instead of just making it exit immediately ?