Resetting project compatibility in vb6

假装没事ソ 提交于 2019-11-30 13:42:40

In a previous job I had, we had a huge VB6 application that contained dozens of VB6 DLLs that we referred across the projects in our project group. We were breaking compatibility often, and manually updating the references like you describe was not an option.

We initially developed a tool that would update references in all .vbp files in a folder after breaking and recompiling, but I eventually found Visual Build by Kinook Software (www.kinook.com) which could deal with this automatically.

I used their solution for many years with success. What's good about their "Make VB6" action (http://www.kinook.com/VisBuildPro/Manual/makevb6.htm) is that it can build a dependency tree and rebuild all your projects in your project group in the right order, while updating references accordingly.

For your scenario, you would need to set the "Set version compatibility before building" option to "No compatibility", and then check the "Set binary compatibility" checkbox so that projects are reverted back to binary compatibility after building.

If you have projects that you need to maintain binary compatibility for, just leave them outside the .vbg and it won't rebuild it.

Additional Visual Basic 5.0 & 6.0 Samples offers a Binary Compatibility Add-In that could be useful. See the ReadMe.txt and Revised Binary Compatibility.doc files after "installing" it (there are steps to take after running the download).

This download includes the document "Revised Binary Compatibility" as well as the Add-in SyncCompt.dll. Binary Compatibility as implemented in Visual Basic 5.0 and Visual Basic 6.0 ensures that new versions of shipping products are fully compatible with older versions. The document explains issues around Binary Compatibility and GUID revision and introduces the DLL. The DLL add-in builds a new compatibility file to stabilize your product (except Standard EXE's which do not have binary compatibility). This tool only works in an Microsoft Windows NT® environment.

This may or may not address your issue.

You shouldn't need to change the compatibility setting. You do however need to make sure that the dll (or exe) that you refer to in your compatibility setting is not the location you are just about to compile into.

We do something similar so we have the following structure:

C:\ProductName\Bin - contains all the live assemblies

C:\ProductName\Bin\Compatibility - contains all the assemblies as they were in the last build

After we do a build (which we do automatically by shelling VB6.exe) we move everything in \Bin to \Bin\Compatibility

I've found the Version Compatibility in ActiveX Components series on MSDN highly enlightening on the subject of compatibility and when/how to break it. I'm posting this mainly for future reference.

I solve the problem by not storing the compatibility information.

I remove the CompatibleEXE32={dllname} line from the .vbp files

I never save the .vbp files after a build , so that the reference does not creep back in.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!