Friday, December 5, 2008

Inheritance under control.

Well, mostly.

In my last post I spoke about the 21 entry inheritance list on a fairly simple ActiveX control.

I looked through each class in the list and decided that I could live without 10 of them because they were implementing features I don't intend to support.

Most were to do with visual controls, but my control is non-visual so those could go.  Others were there for property page and stock property support which I don't need.

So, the list went down to 11 entries, then I added my sole addition to that list - support for browser events.

The removal of many, and addition of one, had a slightly disappointing effect on the size of the DLL though.  Removing the classes I don't need saved around 45K but adding the browser events in added 20K back in.  Still, a 25K saving is better than nothing.

25K may seem a trivial amount given the multi-gigabyte PC memory and terabyte hard drives we enjoy nowadays but I like to ensure that my applications and components only use what they really need. 

Maybe that's my age telling again though.  When I started programming it was on the Commodore VIC-20.  5K of memory, 3.5K useable.  What a luxury the upgrade to the Commodore 64 was!