Activex Controls not working after visible changed?

Activex Controls not working after visible changed?

Post by Mark Sheha » Fri, 22 Oct 2004 17:09:59


Hi all
I have a C# application that uses a number of activex controls on the form.
Mainly WinMedia Player 10 and Internet Explorer controls and a 3rd party
control. For speed of use I cache the forms when the user switches them out
for another form and bring them from the cache as requested. The problem is
that the activex controls dont function after this switch out and back.

The internet explorer one doesnt show the page it is currently on and when i
navigate to a new url the activex control seems to lose sight it is in a
form and appears on the screen outside of the application (usually top left
of my screen) as if it lost its parent container and hence all that
containers parents etc.

The windows media player control doesnt show what was in its last display
(eg a DVD) and when i try to execute any new methods on it (eg full screen)
the app crashes (but within code in the control - not something i can catch
in the de *** ).

This is similar behaviour to the 3rd party activex control so i am assuming
it is a problem with activex controls in windows forms after their visible
property or parent or a reference changes. Its as if the parents handle has
been destroyed.

Any ideas or has anyone come across the same problem?

Thanks
Mark