views:

271

answers:

1

I'm getting "Reentrancy was detected" MDA error while setting a webbrowser control's properties. This only happens if I call "SetWindowsHookEx" to hook some dials within the same thread.

Normally this hooking code works fine but it doesn't play nice with Webbrowser Control. When I ignore the exception code works fine, at least look like fine but obviously I'm a bit worried.

Is there any idea why exactly this error is happening and how to resolve the problem.

I've seen this article in MSDN - http://msdn.microsoft.com/en-us/library/ms172237.aspx but it doesn't help really.

+1  A: 

I figured that out:

  • It should be in the same thread (this was expected)
  • It should not run during the initialization of the unmanaged control. So I run it after setting all properties and events then it worked.
dr. evil