-
Nov 25th, 2017, 03:25 PM
#1
[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
-
Jan 24th, 2020, 03:52 AM
#2
Re: [vb6] Sharing Sample Projects that Include Common Controls
Why is this in the Forum Test Area?
-
Feb 17th, 2020, 07:04 AM
#3
Re: [vb6] Sharing Sample Projects that Include Common Controls
Originally Posted by dee-u
Why is this in the Forum Test Area?
It was probably bumped off by another post before a moderator could see it.
-
Feb 17th, 2020, 08:12 AM
#4
Re: [vb6] Sharing Sample Projects that Include Common Controls
Originally Posted by dee-u
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.
-
Feb 18th, 2020, 02:27 AM
#5
Re: [vb6] Sharing Sample Projects that Include Common Controls
Originally Posted by Steve R Jones
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.
-
Jun 24th, 2021, 07:26 AM
#6
New Member
Re: [vb6] Sharing Sample Projects that Include Common Controls
Originally Posted by LaVolpe
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|