still relating to the ocx.

Posted on 1999-01-11
Medium Priority
Last Modified: 2010-05-03
I wrote a group: project1 - the ActiveX control and project2 - the exe for testing the ActiveX. It was running fine. So, I make the .ocx file in the same folder as the group.

After that I changed something in project1 - the ActiveX. Then I closed project1 and open preject2 - the test exe preject. I found it still used the ocx instead of the updated project1 and there where two ActiveX controls in the tool box.

What I should do?
Question by:johnwood
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
LVL 10

Accepted Solution

caraf_g earned 160 total points
ID: 1455326
You can avoid this happening by setting Binary Compatibility in the Version Compatibility frame on the Component tab of your Project Properties (in project 1)

Alternatively, before each re-compile, unregister the current version by typing in

RegSvr32 -u Project1.ocx (or whatever you compiled it as)

in a command prompt. But the disadvantage of that is that every time you then re-open Project2 it loses the reference to project1 and you'll have to find the ocx again


Author Comment

ID: 1455327
Hi caraf_g

Thank you. I have increase the points so that you may give more help :-)

1. In my case, no re-compile, only open project2. Is your suggestion working in my case?
2. What advantage by the default setting - project compatibility? Why not always use Binary Compatibility? When we use "no compatibility"?!
3. What "Binary" means here?

Author Comment

ID: 1455328
Adjusted points to 80

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Expert Comment

ID: 1455329
Why not just open both projects at the same time, then you can edit both. You can do this with VB5 and VB6. Choose add project rather than open project.
LVL 10

Expert Comment

ID: 1455330
You can avoid having to set compatibility if you use a project group.

This can be achieved as follows:

Open project2.vbp (the executable)

Open project1.vbp (the OCX) by choosing File - Add Project from the menu.

This automatically creates a project group containing project1 and project2, and makes sure that project2 (the executable) is the one that is started when the project is run.

Then, never Make the OCX until you're finished and happy that everything works.

When you close VB, you'll be prompted to save the project group as a .vbg file - after you've done this, always open the .vbg file, never the individual projects.

Hope this helps, and good luck!

Author Comment

ID: 1455331
Yes caraf_g. I always use group and didn't like to make ocx until I thought I can finish the job. However, after "finish", I found I needed to add something to the ActixeX control :-)

I have tried your suggestion (set binary compatibility) but fail to work. Now the problem still there: the exe project still uses the ocx instead of the updated ActiveX project :-(

Author Comment

ID: 1455332
To cognition:
 > Why not just open both projects at the same time,

Yes, I tried open them at the sam time, but the exe project always use the control from the old ocx instesd from the upddated AxtiveX project!

Expert Comment

ID: 1455333
Reference the project and not the control, in Project|components.

You can also delete the control. ALthough you should unregister it first.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

752 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