Results 1 to 6 of 6

Thread: [RESOLVED] OCX Major/Mnior Version Question

  1. #1

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Resolved [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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  2. #2
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,700

    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.

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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.

  4. #4

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: OCX Major/Mnior Version Question

    Quote Originally Posted by dilettante View Post
    ...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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,192

    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>

  6. #6

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width