|
-
Mar 28th, 2020, 05:37 PM
#1
[RESOLVED] OCX Major/Mnior Version Question
Gonna sound nuts... How does one go and force the registered major & minor version to change in a compiled VB ocx?
My goal is to create a simple ocx with the major version > 9 and minor version > 9. However, setting those properties doesn't seem to affect the version information that is registered. For example, I set major to 25 and minor to 11 & compiled the ocx.
You do see those settings in the file properties page when right clicking on the ocx file. But that's not where I wanted it to show -- just don't care.
But when I use OLE/COM Object viewer, look at registry or add ocx to a new project & look at the vbp file, all show version 1.0, i.e.,
Object={D5538258-61AF-4E1D-B111-CCEE41090734}#1.0#0; Project1.ocx
I did manage to get it to go to version 1.1 by adding new public methods. However, that pattern didn't pan out because I can't get the stupid thing past 1.1
Why do I want to do this? For personal education and a test for something else I'm working on.
-
Mar 28th, 2020, 07:15 PM
#2
Re: OCX Major/Mnior Version Question
Yes, one version is the application version (that you can set in the project window) and another version is the OLE version that is mostly automatically handled. I don't know if the proper term is "OLE version" but it is something the like.
To set the OLE version to some bigger number, I suggest to add some dummy properties, as many as the version that you want to reach, set project compatibility, compile, then remove a property, compile again, and repeat until you reach the version that you want, or one less, so you are able to remove all the remaining dummy properties at that moment.
If you want to also set a minor version, you can add properties, but they have to be real properties because you cannot remove them later (without going to the next major version).
Edit: probably you already know all this, but I don't know of other method.
-
Mar 28th, 2020, 08:38 PM
#3
Re: OCX Major/Mnior Version Question
It's actually the typelib version.
You have little control over this unless you have the Binary Compatibility Add-in installed. See http://www.vb.mvps.org/tools/ControlsAndComponents.asp then install it and read the document included.
-
Mar 28th, 2020, 09:18 PM
#4
Re: OCX Major/Mnior Version Question
 Originally Posted by dilettante
...then install it and read the document included.
That did the trick, thanx much.
@Eduardo. I still couldn't get to where I wanted by simply adding/subtracting properties & stuff. But that project dilettante pointed me to worked & I got what I was looking for.
-
Mar 29th, 2020, 09:15 AM
#5
Re: [RESOLVED] OCX Major/Mnior Version Question
> My goal is to create a simple ocx with the major version > 9 and minor version > 9. However, setting those properties doesn't seem to affect the version information that is registered. For example, I set major to 25 and minor to 11 & compiled the ocx.
Did these got written in VBP file in hex i.e. version 23.b?
Edit: Now remember typelib version major and minor turned out to be in hex in registry
sLibName = pvRegGetValue("TypeLib\" & .Guid & "\" & Hex(.MajorVersion) & "." & Hex(.MinorVersion))
cheers,
</wqw>
Last edited by wqweto; Mar 29th, 2020 at 09:19 AM.
-
Mar 29th, 2020, 11:06 AM
#6
Re: [RESOLVED] OCX Major/Mnior Version Question
@wqweto. In VB source files...
Reference = ... #hex.hex#hex
Object = ... #dec.dec#dec
I'm assuming the LCID in Object lines are decimal since major/minor are decimal
In the registry, all are hex
my test results: I set major to 10 and minor to 16
Object={6DB5C5A5-7614-489E-8893-7942BFC94828}#10.16#0; Project1.ocx
in the registry, it showed as: a.10
edited. as expected, within a form hosting the compiled ocx
Object = "{6DB5C5A5-7614-489E-8893-7942BFC94828}#10.16#0"; "Project1.ocx"
Last edited by LaVolpe; Mar 29th, 2020 at 12:32 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|