So I’m writing a component in C# with events that needs to be exposed over COM to VB6.
I’ve already taken all the steps listed here, and the events themselves work fine.
However, something in the machinery of the app means that sometimes COM events aren’t delivered (when multiple events fire in close succession, only the first gets through). I’ve got to the stage of tracing data immediately before it’s raised as an event on the .net side and immediately after it’s handled on the VB side. They are not merely being queued up, or conveyed out of order (would be (more) acceptable), they are raised but not received. All events are raised from the same .net thread. When I step through the code, they are all delivered correctly; in a bare-bones test app they are all delivered even “at speed”.
So some other part of the VB app appears to be preventing these events being delivered. Where should I start looking? Can DoEvents have unintended side effects, for example?
EDIT: clarified the above that only the first of the batch is getting through.
EDIT: restated case (originally COM wrapper was believed to be the problem)
So 6 days of debugging later I arrived at the solution: COM events are just binned and not delivered when you’re at a breakpoint in debug mode. What I was seeing was a combination of two things:
Hopefully this can save someone else wasting this much time on such a stupid issue…