Compatibility of Visual Basic com basic lectures

Source: Internet
Author: User
At the end of the second part of this tutorial, we encountered a small problem, but it is actually a big problem. If we have time, this problem should be worth our effort.

Remember how we encountered that problem? At that time, we first compiled ActiveX DLL and then compiled the test program using the DLL. Next, we re-compile the DLL, Which is because the content in the DLL needs to be modified. However, an error occurs when you run the test program again!
Although, we can re-compile the test program so that the program can run correctly. However, if this is not a VB program, but an Excel data table or a C ++ statistics program is using this DLL, do you need to re-compile these programs after every small modification to ActiveX DLL?

Yes, certainly not.

As experience tells us, this is a compatibility issue. Therefore, you can do this:

Start Visual Basic and open the northwind project;

Select the "project"-> "northwind properties" menu;

Click the "component" label;

You can browse the "version compatibility" page to find three options. Here is an explanation:

No compatibility -- at each compilation, the user COM component is marked with a new tag, which means that the program can only use the DLL of the old tag (Previous Version.

Project compatibility-at each compilation, the user COM component is not always labeled with a new tag. If yes, any currently used application will fail. In fact, this is true only when the current project is significantly different from the compiled DLL project.

Binary Compatibility-during each compilation, the application always tries to save the previously compiled DLL mark, so that the application will not experience a blue screen crash. However, if the DLL to be compiled is too different from the previously compiled DLL, the new mark will be marked.

Let's test the above arguments:

Open the test program in the previous part of this tutorial;

Recompile it;

It should work properly after trial run;

Open the ActiveX dll project;

Set its attribute to binary compatibility;

Recompile the DLL;

Run the test program and it should work properly.

Okay, it seems that the problem has been solved. However, after the DLL is re-compiled, most developers will fall into another incompatible situation.

Is there no better solution? We will temporarily put this problem aside!

You can visit the following sites for more information:

Www. pylonofthemonth. co. uk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.