|
-
Jun 11th, 2010, 08:17 AM
#1
Thread Starter
Lively Member
[RESOLVED] Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
I've had developing an vb6 (sp6) app in my pc with winxp and running it in other with win7.
suddenly, after days running the app, the win7 reports the ERROR
error 481 invalid picture
but really this is not a problem for my new compiled one, but ALL the exe programs (even with dates from several years old) created with vb6.
the error happen in the form1.load or .show.
couriously an form (splash) loaded and show in the main.sub shows ok.
the error is when shows the "main" form.
alse are errors in programs with only form1 without main nor splash.
thus: splash form shows, but not other forms.
I think the culprit is windows update in win7 that have (maybe) replaced some dll or so.
I have try to replace some know dll (as comcat.dll) but win7 don't let you to delete nor replace this file.
Thanks.
Last edited by Guerrero; Jun 12th, 2010 at 07:57 AM.
Reason: RESOLVED
-
Jun 11th, 2010, 10:47 AM
#2
Re: Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
I remember someone complaining about similar situation with Vista. I think the resolution was to look at the icons stored in your resource file and/or embedded into form/control properties, like the form's .Icon property, button/picbox's .Picture properties, etc. If any of those icons contain 32bpp icons, remove them from the icon file and problem went away. There are free apps that allow you to add/remove icons from such icon files. If you want to play with source code for a related app, look at the Icon Organizer project in my signature below.
-
Jun 11th, 2010, 12:33 PM
#3
Thread Starter
Lively Member
Re: Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
 Originally Posted by LaVolpe
I remember someone complaining about similar situation with Vista. I think the resolution was to look at the icons stored in your resource file and/or embedded into form/control properties, like the form's .Icon property, button/picbox's .Picture properties, etc. If any of those icons contain 32bpp icons, remove them from the icon file and problem went away. There are free apps that allow you to add/remove icons from such icon files. If you want to play with source code for a related app, look at the Icon Organizer project in my signature below.
Thanks very much for your info.
not really my case becase programs have been running the last three weeks without problem,
and now fails even programs compiled years ago.
BUT...
your idea is lighting my mind !
AND
I've made a very little vb6 exe with a simple form icon, 16x16 AND FAILS 
THEN i've REMOVED the icon AND the program WORKS 
this the reason the splash forms works, becase don't have icon !
for an real test I will need some time, because I have several projects, forms and exe's.
also the idea of having forms and exe without icons is very ugly.
the real problem sure is some dll or gdi object in Win7, I think.
thanks very much.
-
Jun 11th, 2010, 12:39 PM
#4
Re: Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
I think the error is related to icons/cursors only.
Why? Each new operating system offers more advanced graphics options: NT gave us 24bit/true color icons, XP gave us alphablended icons, Vista gave us PNGs embedded into icon files, Win7 gave us ??? I don't have access to Win7.
So, when an icon resource contains multiple icons, and VB tries to create a stdPicture object from that icon resource, it calls system DLLs to extract a best-fit icon. Well if that best fit icon is a 32bpp icon, VB doesn't support that & invalid picture errors occur. When I say icon resource I'm talking about the icon file you loaded as your .Icon, .Picture properties or uploaded into a resource file. It isn't the size of the icon that is the problem, it is the color depth of the icon(s). I would wager that if you ensured your icon resource only contained 24, 8, 4 or 1 bit icons, you wouldn't have any problems at all.
-
Jun 11th, 2010, 01:14 PM
#5
Thread Starter
Lively Member
Re: Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
 Originally Posted by LaVolpe
I would wager that if you ensured your icon resource only contained 24, 8, 4 or 1 bit icons, you wouldn't have any problems at all.
Ok, I will test this later, but for now I will remove the icons because I need an urgent solution.
Thanks
-
Jun 11th, 2010, 08:06 PM
#6
Re: Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
You may also want to consider replacing LoadPicture with a GDI+ equivalent, especially if you desire 32bpp.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
Sep 7th, 2017, 08:01 AM
#7
Lively Member
Re: [RESOLVED] Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
I used IcoFx to change all of the icons from 32 to True Colors (24 bits). There were some that were 8 and 4.
In the VB6 project, I opened the main form properties and reselected the icon file. That is the only form specifying an icon.
I opened the Project Properties - Make - Application and reselected the main form for the icon.
I still get the 481 error on Windows 7 (x64) test PC.
In Application Manifest Creator > Windows Vista and above > Windows Settings > 2017 NameSpace, there is a [_] Gdi Scaling. Is that relevant?
Last edited by anderci; Sep 7th, 2017 at 08:10 AM.
-
Sep 7th, 2017, 11:11 AM
#8
Lively Member
Re: [RESOLVED] Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
I took my tiny NoOCX VB6 program and added a True Colors (24 bits) icon to the main form. It appears in the title bar of the form and the icon for the .exe file.
I went through the same 'repair process' with all 4 of my primary applications
I still get the 481 error on Windows 7 (x64) test PC for all of them.
HELP Please!
-
Sep 8th, 2017, 05:07 AM
#9
Re: [RESOLVED] Error 481 - Invalid picture in compiled exe (vb6 sp6) in Win7
Hi anderci
Could you please start your own thread rather than resurrecting an old one like this. I'm going to close this one so it can sink back into history.
Thanks
FD
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
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
|