How can I tell VB always createing the same GUID for the same OCX Project

Posted on 2000-02-04
Medium Priority
Last Modified: 2012-05-04
My ActiveX control contains an other ActiveX control. When I compile this
second control, a new GUID will be created. My problem is that VB says the
project which contains the second ActiveX control could not be loaded
correctly. I assume  the problem is the GUID of the second control, because the path of the new OCX is the same as the old on. Although in the menu
Projekt > Components are several OCX´es with the same name.
Could you give me a tip how to tell VB compiling the new OCX in the same way as the old one.
Question by:_alpha
  • 3

Accepted Solution

p_biggelaar earned 800 total points
ID: 2489353
There is one way to ensure that your newly compiled control is compatible with the previous version. This is by setting the version compatibility to binary.

You can find this setting on the components tab (for the second control) of the project properties sheet.

Bare in mind that VB can only maintain compatibility with a previous version when you:
- don't change the existing methodcall's (i.e. if you decide that an existing method needs another parameter: forget compatibility, on the other hand it's perfectly okay to change something in the code of the method itself)

- don't delete existing properties/methods/events

- you can add anything you like.

With respect to the first note: it's common practice for released ocx or dll that when a method call has to be changed to reflect new functionality, you will find a new method implementing the new call, while the existing method remains unchanged. This is purely to preserve compatiblity.

If you do this and bare the restrictions in mind, you shouldn't have any further problems!

Good luck!

Expert Comment

ID: 2489365
Oh, forgot to mention:
Please make sure that the first time you compile the control using binary compatiblity you'll add the correct component/reference to other project.

Just in case: project properties can be found in the menu (project -> <projectname> properties) or by rightclicking the project in the project explorer.

LVL 12

Expert Comment

ID: 2491156
Check the 'Upgrade ActiveX controls' in your Project Properties before compiling.
Also check the compability setting as p biggelaar suggested !

Author Comment

ID: 2499669
Thank you,

now I can compile a new version and use it without problems

Expert Comment

ID: 2499773
You're welcome.

See ya

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question