
The infamous Message Filter error - Illegal to call out while ins ide Message Filter (-2147418107)
When a process tries to make two concurrent out-of-process COM calls,
the second fails with error -2147418107, "it is illegal to call out
while inside message filter." If the second call happens to be a
RaiseEvent statement, the event is simply lost without error. Refer to
http://www.*-*-*.com/
SD=gn&FR=0.
How have others out there worked around this problem? This problem
happens most often when VB code gets re-entered, either because of a
Timer event firing or because of an incoming COM call. I've found
articles suggesting you rewrite the default message filter to prevent
reentrancy from happening, e.g.,
http://www.*-*-*.com/
SD=gn&FR=0, but this seems a bit extreme.
Has anyone tried this? Has anyone come up with a better solution?