still relating to the ocx.

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?
Who is Participating?
caraf_gConnect With a Mentor Commented:
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

johnwoodAuthor Commented:
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?
johnwoodAuthor Commented:
Adjusted points to 80
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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.
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!
johnwoodAuthor Commented:
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 :-(
johnwoodAuthor Commented:
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!
Reference the project and not the control, in Project|components.

You can also delete the control. ALthough you should unregister it first.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.