Results 1 to 6 of 6

Thread: [vb6] Sharing Sample Projects that Include Common Controls

  1. #1

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

    [vb6] Sharing Sample Projects that Include Common Controls

    This thread is only pertinent if you are using the Windows common controls in your project.

    There are at least three versions of the common controls floating around. Depending on which you have referenced in your project and which exists on the downloader's PC, the project may fail to load properly. If so, the person downloading your code likely falls into two categories: a) your code stinks and is broken and was a waste of time downloading it, or 2) confused.

    How to address this problem? First, open your intended upload's vbp file in NotePad. Find the line near the top that references the common controls, it will look like one of the following:

    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
    or (shouldn't be including both)
    Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0; comctl32.ocx

    If your project's version numbers are the same as those above (in bold), no problems should be experienced by anyone downloading your sample project. But if they are not the same, then problems can occur if the user's version is older than yours. In that case, the user is told that the project could not load the referenced ocx. Additionally, if the user continues to load the project, all your common controls (treeview/listviews for example) become picture boxes and when user tries to run the project, errors galore.

    To prevent that problem, you could simply modify that line by replacing the newer version number with the appropriate bolded one above. This does nothing to your project on your system. When you open your project and later save it, the version changes back to what it was. But this is important: The line you want to modify exists in the vbp file and each .frm, .ctl, .ppg and .dob file that uses those controls. The entry you will be looking for is also near the top of those files. It doesn't hurt to double check other project files just in case I missed listing one of their extensions. Note: If you install a patch/update that upgraded your versions, the next time you open & save any projects that use those controls, the versions will change to the most current on your system.

    After above is performed, those downloading your sample project will be using their version (same or higher). Only when their version is older than the one listed in the project, will there be a problem for them. Luckily, so far, the different versions remain binary compatible with each other.

    FYI: The version installed on any PC is due to SP6 and/or one of its security patches, possibly other Microsoft software you've installed, or maybe even Windows updates. Asking people to install a more recent SP6 security-patch to make their version the same or higher than yours is typically not an option.

    2004 SP6 original
    2012 SP6 security patch reflects mscomctl.ocx as v2.1 and comctl32.ocx as v1.4
    2016 SP6 security patch reflects mscomctl.ocx as v2.2 and comctl32.ocx as v1.5
    Last edited by LaVolpe; Aug 21st, 2018 at 04:34 PM. Reason: wordsmithing
    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
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: [vb6] Sharing Sample Projects that Include Common Controls

    Why is this in the Forum Test Area?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Posts
    532

    Re: [vb6] Sharing Sample Projects that Include Common Controls

    Quote Originally Posted by dee-u View Post
    Why is this in the Forum Test Area?
    It was probably bumped off by another post before a moderator could see it.

  4. #4
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Largo, FL.
    Posts
    1,826

    Re: [vb6] Sharing Sample Projects that Include Common Controls

    Quote Originally Posted by dee-u View Post
    Why is this in the Forum Test Area?
    Why did you wait so long to ask your question about a thread from Nov 25th, 2017?

    Just kidding... I'm guessing you really weren't expecting an answer but I made one up anyway.

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: [vb6] Sharing Sample Projects that Include Common Controls

    Quote Originally Posted by Steve R Jones View Post
    Why did you wait so long to ask your question about a thread from Nov 25th, 2017?

    Just kidding... I'm guessing you really weren't expecting an answer but I made one up anyway.
    I was actually asking the OP since I thought this post was rather helpful to be just in the Forum Test Area, or probably he has posted this also in an appropriate section.

    EDIT: This post has actually helped me recently and I couldn't rate it since it is in the Forum Test Area.
    Last edited by dee-u; Feb 18th, 2020 at 03:00 AM.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6
    New Member
    Join Date
    May 2020
    Posts
    6

    Thumbs up Re: [vb6] Sharing Sample Projects that Include Common Controls

    Quote Originally Posted by LaVolpe View Post
    This thread is only pertinent if you are using the Windows common controls in your project.

    There are at least three versions of the common controls floating around. Depending on which you have referenced in your project and which exists on the downloader's PC, the project may fail to load properly. If so, the person downloading your code likely falls into two categories: a) your code stinks and is broken and was a waste of time downloading it, or 2) confused.

    How to address this problem? First, open your intended upload's vbp file in NotePad. Find the line near the top that references the common controls, it will look like one of the following:

    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
    or (shouldn't be including both)
    Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0; comctl32.ocx

    If your project's version numbers are the same as those above (in bold), no problems should be experienced by anyone downloading your sample project. But if they are not the same, then problems can occur if the user's version is older than yours. In that case, the user is told that the project could not load the referenced ocx. Additionally, if the user continues to load the project, all your common controls (treeview/listviews for example) become picture boxes and when user tries to run the project, errors galore.

    To prevent that problem, you could simply modify that line by replacing the newer version number with the appropriate bolded one above. This does nothing to your project on your system. When you open your project and later save it, the version changes back to what it was. But this is important: The line you want to modify exists in the vbp file and each .frm, .ctl, .ppg and .dob file that uses those controls. The entry you will be looking for is also near the top of those files. It doesn't hurt to double check other project files just in case I missed listing one of their extensions. Note: If you install a patch/update that upgraded your versions, the next time you open & save any projects that use those controls, the versions will change to the most current on your system.

    After above is performed, those downloading your sample project will be using their version (same or higher). Only when their version is older than the one listed in the project, will there be a problem for them. Luckily, so far, the different versions remain binary compatible with each other.

    FYI: The version installed on any PC is due to SP6 and/or one of its security patches, possibly other Microsoft software you've installed, or maybe even Windows updates. Asking people to install a more recent SP6 security-patch to make their version the same or higher than yours is typically not an option.

    2004 SP6 original
    2012 SP6 security patch reflects mscomctl.ocx as v2.1 and comctl32.ocx as v1.4
    2016 SP6 security patch reflects mscomctl.ocx as v2.2 and comctl32.ocx as v1.5
    Thanks Lavolpe. You always been my God father in Such issues. My problem is resolved by using Last Security Roll up Update.

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