J
Joshua Frank
Hi All,
I posted this a while back without much success, so I thought I'd again.
Basically, I want to set things up so that I can be notified when a
method terminates:
Sub Test()
'indicate that we want to be notified when Test terminates
RegisterForEvent(AddressOf MyCallbackFunction)
...
End Sub
Then when Test terminates, the framework would call the callback
function. I've looked into the profiling API, but this is more than I
need, and would be very difficult to implement for various reasons. And
yes, I know that this is more or less the same as:
Sub Test()
Try
...
Finally
MyCallbackFunction()
End Try
End Sub
but I want to avoid the Try block, preferring to save this construct for
situations where exceptions may be thrown.
So does anyone know a way to do this? I think it ought to be possible
to work with the framework, or maybe hack a little to replace the return
location on the stack with MyCallbackFunction, rather than the true
caller. But I'd really like to figure this one out. TIA.
Cheers,
Josh
I posted this a while back without much success, so I thought I'd again.
Basically, I want to set things up so that I can be notified when a
method terminates:
Sub Test()
'indicate that we want to be notified when Test terminates
RegisterForEvent(AddressOf MyCallbackFunction)
...
End Sub
Then when Test terminates, the framework would call the callback
function. I've looked into the profiling API, but this is more than I
need, and would be very difficult to implement for various reasons. And
yes, I know that this is more or less the same as:
Sub Test()
Try
...
Finally
MyCallbackFunction()
End Try
End Sub
but I want to avoid the Try block, preferring to save this construct for
situations where exceptions may be thrown.
So does anyone know a way to do this? I think it ought to be possible
to work with the framework, or maybe hack a little to replace the return
location on the stack with MyCallbackFunction, rather than the true
caller. But I'd really like to figure this one out. TIA.
Cheers,
Josh