issue with class interface method not getting called

k… That all worked… Now going to do the same thing, but do the type cast to the class interface…

You have to type cast it to the window type, not the interface.

okay… type casting to the window worked, but it defeats the purpose of using the class interfaces and the observers… i need to figure out why only this one window class and this one class interface do not work…

Yes, but this is for testing purposes only.

Can you now, as the 3rd step, call the method directly on this win variable, like this:

Dim win As TheProblematicWindowClass = TheProblematicWindowClass(o) win.GotConnectionClosed pData
Does this work?

yup… that worked perfectly…

Interesting and puzzling. Doesn’t make sense to me why your code in the first place is not working then. The last thing which comes to my mind is the ImplicitInstance property of the window. I don’t think it has anything to do with this case, but from time to time I was able to solve some problems by turning it off.

The window that is not working has implicit instance turned off…
I toggled the property in the inspector and still not working…

hmm… I decided to skip out the loop and just did

GotConnectionClosedObservers(2).GotConnectionClosed pData

and the window method was received… so it looks like something happens within the loop…

One thing not related to your problem: instead of

for each o as Variant in GotConnectionClosedObservers

you should write:

for each o as GotConnectionClosedInterface in GotConnectionClosedObservers

yes, in the original code it was the class interface and the modified code used the variant data type…

Thanks for all your help, but it seems the issue was something else, so will try to replicate in a small test project and submit a bug report…

Basically there were three items in the observers array property
(0) = window1
(1) = container control
(2) = window2

When the notify looped over the elements in the array, window1 was closing the container control in the GotConnectionClosed method… The container control seemed to still be valid and the GotConnectionClosed method was received there as well, but the loop was just dropping out after the container control… By removing the container control from the array, everything works fine…