Results 1 to 1 of 1

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

  1. #1

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Beside Waldo

    [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}

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