The new vbAccelerator Site - more VB and .NET Code and Controls

Articles

&nbsp

VB Problem with Multiple UserControls in Binary Compatible Package

 
A word of warning!
 
Problems...
 
&nbsp
Overview

VB can have problems trying to build ActiveX controls under certain circumstances. The circumstance I discovered is that VB cannot build a binary compatible control which:

  1. Contains more than one UserControl
  2. Two or more UserControls refer to each other (for example, one control is a child of another)
  3. One UserControl contains the Implements statement.
I discovered this problem when trying to rebuild my ListBar component. This control consists of a main container control which provides bar selection buttons and a child ListView control which provides the sheets themselves. It seemed to be a sensible design decision to code the ListView control into the ListBar component itself, and to hide the control from external users by making it private. Then the ListView control would be self-contained, responding to its own keyboard and mouse events and raising events to its parent control. Easy. Unfortunately, whilst this approach works the first time around, once the binary compatible flag has been set for the ActiveX control, it is impossible to ever compile a new version of the control without breaking the binary compatiblity.

In Detail

Normally, this problem does not come about. How often do you need to create multiple UserControls and implement a library? The reason it occurs in my controls is because You can cause this problem to occur yourself using either VB5 or VB6. Simply create a component with

How to Fix it




TopBack to top
ArticlesBack to Articles

&nbsp
 

About  Contribute  Send Feedback  Privacy

Copyright © 1998-1999, Steve McMahon ( steve@vbaccelerator.com). All Rights Reserved.
Last updated: 15 November 1999