The OleObjectBlob Problem

image\BLOBWARN.gif

If you get this warning while doing a build, you've got the OleObjectBlob problem.

Should you be concerned? The OleObjectBlob problem can cause load errors in VB4 and an instant crash in VB5. And when VB5 goes down, it can take Windows 95 with it. So yes indeed, you should be concerned.

What IS the OleObjectBlob Problem?

To make a long story short:

1. An OleObjectBlob is a complex binary property (actually a set of properties) stored in binary stash files.

2. As used in some, though not all OLE controls, OleObjectBlobs are sensitive to their precise location in the binary stash file, ie when VB writes them into stash files, some of the data written encodes the offset from the beginning of the file.

3. When building a new single-language executable, VBLM rewrites stash files if you have extracted and translated string properties stored in them.

4. If the translations are longer than the originals, if the stash file contains one or more OleObjectBlobs, and if the translated properties come BEFORE them in the file, then the stash file written by VBLM will hold the blobs in a new location.

5. This obsoletes some of the OleObjectBlob data, and when VB tries to load it...

6. BOOM!

Avoiding the OleObjectBlob Problem

Before coding a warning into VBLM and writing this topic, I spent MANY hours trying to figure out how to have VBLM reverse-engineer OleObjectBlobs on the fly and update the data obsoleted by the move. This turned out to be an impossible task, and I gave up (reluctantly). As of now, OleObjectBlob problems can't be fixed. They can, however, be avoided by making changes in either the translations or in your original VB project:

1. Change the translations to be no longer than the originals (shorter isn't a problem, because VBLM will pad the stash file with nulls to keep things in the same place).

2. Change the order in which the controls appear in the form definition section (this determines the order in the stash file) so that the translated properties come AFTER the blobs instead of before. There are two ways to do this:

a. Edit the files with a text editor to move controls into the proper order, then load and resave them in VB to get the stash file updated. This struck me as a little risky, but it seems to work fine.

b. Cut and paste the controls within VB, or recreate the forms. Remember that, menus aside, control order in form definitions is usually the reverse of the order in which they are created.

I wish I could have implemented a transparent solution to this problem, but this is the best I can do for now. Forewarned is forearmed.