Discussion:
TypeLib Version
(too old to reply)
SV
2008-08-18 06:01:00 UTC
Permalink
Hi,

I have developed a MFC activec control (typelib version 1.0) and it is
working fine.

1. If I change the major version of the typelib to say 2.0 , then i'm not
able to use the activex control. Is it enough to just change the version no
in the ODL file or is there anything else we need to do?

2. When should I change the major/minor version of the tlb. Do I have to
change the version number whenever there is a change in the interface, that
is a new property/method is added?
Geeky Badger
2008-08-18 14:24:19 UTC
Permalink
Hi SV,

First, you copy your project folder. Next find all the GUIDs being
used in the program and use the GUIDGen.exe utility to make new ones.
Make a table so you know which new guid replaces which old guid. Go
through the source files and replace all of the guid's. In the
project settings under the link tab change the output .OCX name to the
next number (Make sure you get both release and debug, etc). Change
the library name in the .DEF file to match this new number. Change
the Major version const in the app. file. Change all of the "Ctrl.1"
to "Ctrl.2" in the control file. Change all the "PropPage.1" to
"PropPage.2" in the Ppg file.

Now in your code that references the controls you can change the GUID
for the object from the #1 to the #2 guid wherever it is stored in a
source file. Then as long as you didn't change the usage of #1's
properties/methods/events in #2 your old code will just work and it
will now have access to the new things in #2.

Old compiled code that references #1 will go after the #1.ocx and work
as before. New programs which reference the #2.ocx will go after the
new library.

Code that get its objects via "CreateObject" will ask for <object>.1
or <object>.2 from the registry which will direct them to the correct
.ocx library.

-GB
Post by SV
Hi,
I have developed a MFC activec control (typelib version 1.0) and it is
working fine.
1. If I change the major version of the typelib to say 2.0 , then i'm not
able to use the activex control. Is it enough to just change the version no
in the ODL file or is there anything else we need to do?
2. When should I change the major/minor version of the tlb. Do I have to
change the version number whenever there is a change in the interface, that
is a new property/method is added?
Loading...