Bug in MSDN ActiveX Hosting code

If you’re using the sample code from Alex Feinman’s MSDN article on hosting ActiveX controls, then you might be interested to know that we’ve found and fixed a bug in it.  The original code doesn’t properly clean up and destroy the native control instances, so the native destructor is never called and you leak objects.  For many things like Media Player, where you create one control and use it for the life of your app it’s not much of a problem, but if you’re creating and disposing a lot of controls in your app, it is a problem.

The fixed file is available here [AxHost.zip (7.89 KB)]

2 thoughts on “Bug in MSDN ActiveX Hosting code”

  1. hi!
    i have used the fix proposed by you but it seems that it does not actually fix the bug in my application.

    Are there any other things that i need to update?


  2. Your code helped me in fixing few issues. But the many problems are there with the AxHost control. One of the problem is "Application process is not terminating" even though the application is close.

    Any suggestions?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s