0

I recently had an issue where I was able to add an icon to a (VB6) form on one PC where it worked fine, but they was unable to run/compile it on a second PC.

It turned out that the icon file was 32-bit (including an alpha channel) and this was the problem. But I was surprised that this was a system-dependent feature.

(In this specific example it was Win10 x64 which allowed the 32-bit icon, and Win7 x32 which did not).

So now it seems quite unclear what icons are permissible to use in VB6 in which versions of Windows?


I have seen examples such as this question which have a similar issue, and this other question outlines what may have been the original VB6 features when it was new (?) but I can't yet find information that comprehensively breaks down what has changed based on Windows version.

This is important because we don't need to necessarily live within the limitations of (say) Windows XP if we know we are deploying to Windows 8 / 10 only. But nor do I want to risk that a fraction of users will have some dire problem because of this.


I've dug into this a little more - it appears that the Windows API function OleLoadPicturePath() behaves differently in the two Windows versions I mentioned above. On Win7, it will error out with a 32-bit icon; but on Win10 it does not. I'm not sure if there are other API functions which differ also, or not.

3
  • 1
    Hard to say without knowing what you are actually doing with the icon. Certainly there is plenty of platform support for 32 bit bitmaps with alpha channel on XP and above. Jan 18, 2019 at 16:08
  • You can have icons with different sizes, up to 512x512. Jan 18, 2019 at 16:09
  • @DavidHeffernan I dug into the code I was using and narrowed it down somewhat to a particular Windows API function - question updated.; Jan 24, 2019 at 20:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.