Fog Creek Software
Discussion Board




VB6 Class file question

Hi,

I just was about to tackle a problem and thought that I could get some ideas from the group. First some background. The app is written in VB6 and has been architected to separate the business logic into a dll and the ui into the exe. Unforunately when I setup the business logic dll, I made an error on one of the properties of a class, it should have been a long, but intead is an int. I was planning on changing the interface and recompiling the app and all associated dependent exes.

What, if any, other ways can I do this without breaking binary compatibility? If I define a different interface, should I change the current interface to raise an error if it is used?

Ideas?

Thanks,

Kevin

Kevin Moore
Wednesday, April 14, 2004

If you change the property's type you break compatibility - period.  To avoid this, you'd have to add a new property.  But if you're re-compiling everything that uses the .DLL it shouldn't matter - as long as you're _really_ re-compiling *everything* that uses the .DLL.  Notice my skepticism ;-)

As far as using the old property, have it delegate to the new property and don't worry about raising an error - that'll take care of itself.  If the return value from the new property is too big for the old property's Integer value, it'll raise an error to the client.  If it doesn't, great.  An assignment to the old property from the client's code will have a similar behavior.  If the caller's attempt succeeds then great.  If not, then VB couldn't convert the caller's Long value to the old Integer property and an error will be raised.

bpd
Wednesday, April 14, 2004

*  Recent Topics

*  Fog Creek Home