At the end of the second part of this tutorial, we run into a small problem, but that's actually a big problem, to be honest. If we have time, this issue should be worth our efforts to study.
Remember how we encountered that problem? At that time, we first compiled the ActiveXDLL and then compiled the test program that used the DLL. Next, we recompile the DLL, assuming that the contents of the DLL need to be modified. However, when I run the test program again, an error occurs!
Yes, that certainly can't be the case.
Because experience tells us that this is a compatibility issue. So, it can be handled like this:
Start Visual Basic and open the Northwind project;
Select the "PRoject"->"NorthwindProperties" menu;
Click the "Component" tab;
Browsing the "VersionCompatibility" page content, you can find three options. Let me explain now:
NoCompatibility - Every time you compile, the user COM component is marked with a new tag, which means that the program can only use the old tag (previous version) of the DLL.
ProjectCompatibility - User COM components are not always marked with a new tag each time they are compiled. If it is, any currently used applications will fail. In fact, this will only happen if the current project is significantly different from the compiled DLL project.
BinaryCompatibility - Each time it is compiled, the application always tries to save the previously compiled DLL tag, thus ensuring that the application used will not have a blue screen of death. However, if the current DLL to be compiled is too different from the previously compiled DLL, a new tag will be marked.
Let's test the above argument:
Open the test program from the previous part of this tutorial;
Recompile it;
Give it a test run and it should work normally;
Open the ActiveXDLL project;
Set its property to BinaryCompatibility;
Recompile the DLL;
Give the test program a try and it should work fine.
Ok, it looks like the problem has been solved. But when the DLL is recompiled, most developers will fall into another incompatibility situation.
Isn't there a better solution? Let’s put this issue aside for now!
You can visit the following sites for more content:
www.PylonOfTheMonth.co.uk.->