|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error 481 Invalid pictureHi,
I have Win XP, when I run my application using right click > run as > check 'protect my computer and data from unauthorized program activity' I get an error Run-time error '481': Invalid picture Why this is happening? and any fixes for that? Thanks in advance ab "Abhishek" <u***@server.com> wrote in message This usually happens when an image is higher than 32 bit colours (I think, news:i5le5i$h41$1@speranza.aioe.org... : Hi, : : I have Win XP, when I run my application using right click > run as > check : 'protect my computer and data from unauthorized program activity' I get an : error : : Run-time error '481': Invalid picture : : Why this is happening? and any fixes for that? it's ben awhile, but the problem has been documented here before). If the action you have coded in the checkbox deals with showing an image or icon, then chances are the image is in fact not recognized by VB. If you Google the error with terms like VB and picutre or icon, the solution is out there. I forget what it is off the top of my head. I just tested it further. I dont think its about 32-bit color images, if I
assign the form an icon from the properties it gives errors, no matter how many colors are there in the image. even 16 color icons gives the same error. On 01/09/2010 12:41, Abhishek wrote:
> Hi, Standard debugging and error handling practices apply to try and find > > I have Win XP, when I run my application using right click> run as> check > 'protect my computer and data from unauthorized program activity' I get an > error > > Run-time error '481': Invalid picture > > Why this is happening? and any fixes for that? out what it is loading. http://hashvb.earlsoft.co.uk/Debugging I don't know what that option does (I have no access to XP) but it sounds like a limited user/sandbox environment. -- Dee Earley (dee.ear***@icode.co.uk) i-Catcher Development Team iCode Systems (Replies direct to my email address will be ignored. Please reply to the group.) error handling wont work since the error is not happening at some procedure.
even if you set any icon to form it produces this error when ran, seems like a bug. Show quoteHide quote "Dee Earley" <dee.ear***@icode.co.uk> wrote in message news:%23GX%23CpoSLHA.3580@TK2MSFTNGP06.phx.gbl... | On 01/09/2010 12:41, Abhishek wrote: | > Hi, | > | > I have Win XP, when I run my application using right click> run as> check | > 'protect my computer and data from unauthorized program activity' I get an | > error | > | > Run-time error '481': Invalid picture | > | > Why this is happening? and any fixes for that? | | Standard debugging and error handling practices apply to try and find | out what it is loading. | http://hashvb.earlsoft.co.uk/Debugging | | I don't know what that option does (I have no access to XP) but it | sounds like a limited user/sandbox environment. | | -- | Dee Earley (dee.ear***@icode.co.uk) | i-Catcher Development Team | | iCode Systems | | (Replies direct to my email address will be ignored. | Please reply to the group.) "Abhishek" <u***@server.com> wrote in message It's weird, that. I've just created a completely empty VB project on my XP news:i5o2bq$i0l$1@speranza.aioe.org... > even if you set any icon to form it produces this > error when ran, seems like a bug. laptop (just one Form, no code at all, and set the Form's Icon property to an .ico file) and the compiled exe (both native and pcode) bombs out with an Invalid picture error when I right click the exe and select "Run As" with a tick in "Protect my Computer", before it even shows the Form. There is of course a warning against that option to the effect that using it might result in some programs not working but (unless I'm mistaken) I do seem to recall doing that before with a VB6 exe and I seem to recall it working okay. I could be wrong on that one though. I'm wondering if it is a Service Pack issue or something (I'm using SP6B, which I believe tightened up a security issue with the original SP6)? Mike
Show quote
Hide quote
"Mike Williams" <M***@WhiskyAndCoke.com> wrote in message Could the .ico file you are loading be causing the problem? How about tryingnews:i5o6ld$oi9$1@speranza.aioe.org... > "Abhishek" <u***@server.com> wrote in message > news:i5o2bq$i0l$1@speranza.aioe.org... > > > even if you set any icon to form it produces this > > error when ran, seems like a bug. > > It's weird, that. I've just created a completely empty VB project on my XP > laptop (just one Form, no code at all, and set the Form's Icon property to > an .ico file) and the compiled exe (both native and pcode) bombs out with an > Invalid picture error when I right click the exe and select "Run As" with a > tick in "Protect my Computer", before it even shows the Form. There is of > course a warning against that option to the effect that using it might > result in some programs not working but (unless I'm mistaken) I do seem to > recall doing that before with a VB6 exe and I seem to recall it working > okay. I could be wrong on that one though. I'm wondering if it is a Service > Pack issue or something (I'm using SP6B, which I believe tightened up a > security issue with the original SP6)? > > Mike > > again but without the .ico file? Neil.. No, happens with any icon file.
Show quoteHide quote "NeilH" <neil@no-spam.co.uk> wrote in message news:e94yu7pSLHA.5572@TK2MSFTNGP02.phx.gbl... | | Could the .ico file you are loading be causing the problem? How about trying | again but without the .ico file? | | Neil.. | | are there two versions of SP6 releases?
Show quoteHide quote "Mike Williams" <M***@WhiskyAndCoke.com> wrote in message news:i5o6ld$oi9$1@speranza.aioe.org... | okay. I could be wrong on that one though. I'm wondering if it is a Service | Pack issue or something (I'm using SP6B, which I believe tightened up a | security issue with the original SP6)? | | Mike | | On 02/09/2010 14:41, Abhishek wrote:
> are there two versions of SP6 releases? SP6 and SP6 for VB only (iirc)-- Dee Earley (dee.ear***@icode.co.uk) i-Catcher Development Team iCode Systems (Replies direct to my email address will be ignored. Please reply to the group.) "Abhishek" <u***@server.com> wrote in message I know that SP6 fixed some bugs and introduced others, and I held off news:i5o9ir$tam$1@speranza.aioe.org... > are there two versions of SP6 releases? installing it for a good while. When I did decide to finally install it I noticed the download was called vs6sp6B and I just assumed that the "B" indicated it was an updated version with the bugs fixed, but I might be wrong on that one and the "B" might actually mean "Basic"? I can't remember which new bugs were introduced in the original release of SP6 and so I don't know whether the current version (if it indeed is a new version?) fixes them or not. What I do know is that on my own XP machine I have vs6sp6B installed and in a brand new and completely empty single Form compiled VB6 project with an .ico file assigned to the Form (any .ico file, and I've tried dozens of different ones) I get exactly the same Invalid Picture problem that you are having yourself when I run the compiled exe under the conditions you stated. Since XP and VB6 have been out for a long time and since I have never heard of that problem before then I thought that it might just be a new problem introduced by SP6. That's just a guess of course, and perhaps someone here running SP5 or lower might like to perform the same test? Mike I tested it further it doesn't happen when we programmatically change icon.
only if we not set the icon at design time. Show quoteHide quote "Mike Williams" <M***@WhiskyAndCoke.com> wrote in message news:i5ojbj$duo$1@speranza.aioe.org... | "Abhishek" <u***@server.com> wrote in message | news:i5o9ir$tam$1@speranza.aioe.org... | | > are there two versions of SP6 releases? "Abhishek" <u***@server.com> wrote in message Yep. I tried that myself, but then your exe itself is stuck with the default news:i5ojqc$ejv$1@speranza.aioe.org... > I tested it further it doesn't happen when we programmatically > change icon. only if we not set the icon at design time. icon until it is run. That might not be a problem for you of course, but if it is then you would need to change the embedded icon in the compiled exe itself. I don't know how to do that in code, but there are ready made utilities that can do it for you. In fact I've just done it using one such utility and the exe icon changes okay, although the Form's icon when the exe is run does not, so you would still need to set that in code, and you would need to do so in such a way that did not fall foul of the restrictions of the method of running that you have outlined, which according to this page are quite severe: http://blogs.msdn.com/b/aaron_margosis/archive/2004/09/10/227727.aspx Mike yep, i changed icon in exe using resource hacker, but that only changes exe
icon not form. for chaning form icon i used the vbaccelator code to load xp icon from resouces and it works fine. Show quoteHide quote "Mike Williams" <M***@WhiskyAndCoke.com> wrote in message news:i5ongd$knc$1@speranza.aioe.org... | "Abhishek" <u***@server.com> wrote in message | news:i5ojqc$ejv$1@speranza.aioe.org... | | > I tested it further it doesn't happen when we programmatically | > change icon. only if we not set the icon at design time. | | Yep. I tried that myself, but then your exe itself is stuck with the default | icon until it is run. That might not be a problem for you of course, but if | it is then you would need to change the embedded icon in the compiled exe | itself. I don't know how to do that in code, but there are ready made | utilities that can do it for you. In fact I've just done it using one such | utility and the exe icon changes okay, although the Form's icon when the exe | is run does not, so you would still need to set that in code, and you would | need to do so in such a way that did not fall foul of the restrictions of | the method of running that you have outlined, which according to this page | are quite severe: | | http://blogs.msdn.com/b/aaron_margosis/archive/2004/09/10/227727.aspx | | Mike | | | | yep, the restrictions are severe but the invalid picture error should occur
since we are not doing anything. seems like a bug in the vb stdpicture class. I discovered it a year back but ignored it since my app is running fine even in guest account. Show quoteHide quote "Mike Williams" <M***@WhiskyAndCoke.com> wrote in message news:i5ongd$knc$1@speranza.aioe.org... | "Abhishek" <u***@server.com> wrote in message | news:i5ojqc$ejv$1@speranza.aioe.org... | | > I tested it further it doesn't happen when we programmatically | > change icon. only if we not set the icon at design time. | | Yep. I tried that myself, but then your exe itself is stuck with the default | icon until it is run. That might not be a problem for you of course, but if | it is then you would need to change the embedded icon in the compiled exe | itself. I don't know how to do that in code, but there are ready made | utilities that can do it for you. In fact I've just done it using one such | utility and the exe icon changes okay, although the Form's icon when the exe | is run does not, so you would still need to set that in code, and you would | need to do so in such a way that did not fall foul of the restrictions of | the method of running that you have outlined, which according to this page | are quite severe: | | http://blogs.msdn.com/b/aaron_margosis/archive/2004/09/10/227727.aspx | | Mike | | | | "Abhishek" <u***@server.com> wrote in message Whoa. I read something about that not too long ago. Hang tight, I need to news:i5oqdr$pdg$1@speranza.aioe.org... : yep, the restrictions are severe but the invalid picture error should occur : since we are not doing anything. seems like a bug in the vb stdpicture : class. I discovered it a year back but ignored it since my app is running : fine even in guest account. go digging for it. - Kev TYPO
invalid picture error should NOT occur. sorry for my bad english. Show quoteHide quote "Abhishek" <u***@server.com> wrote in message news:i5oqdr$pdg$1@speranza.aioe.org... | yep, the restrictions are severe but the invalid picture error should occur | since we are not doing anything. seems like a bug in the vb stdpicture | class. I discovered it a year back but ignored it since my app is running | fine even in guest account. | "Abhishek" <u***@server.com> wrote in message Okay, here you go: Error message when you run a Visual Basic application news:i5oqdr$pdg$1@speranza.aioe.org... : yep, the restrictions are severe but the invalid picture error should occur : since we are not doing anything. seems like a bug in the vb stdpicture : class. I discovered it a year back but ignored it since my app is running : fine even in guest account. that contains an ImageList control that uses an IPicture interface: "Error 481: Invalid Picture" http://support.microsoft.com/kb/974899 Apparently it has something to do with a hotfix that replaces a hotfix that did something to the VB OCX controls. See if that helps. > error message when you run a Visual Basic application that contains an there is no control or code at all on/in the form.> ImageList control Show quoteHide quote "Kevin Provance" <k@p.c> wrote in message news:i5osnf$aon$1@news.eternal-september.org... | | "Abhishek" <u***@server.com> wrote in message | news:i5oqdr$pdg$1@speranza.aioe.org... | : yep, the restrictions are severe but the invalid picture error should | occur | : since we are not doing anything. seems like a bug in the vb stdpicture | : class. I discovered it a year back but ignored it since my app is running | : fine even in guest account. | | Okay, here you go: Error message when you run a Visual Basic application | that contains an ImageList control that uses an IPicture interface: "Error | 481: Invalid Picture" http://support.microsoft.com/kb/974899 | | Apparently it has something to do with a hotfix that replaces a hotfix that | did something to the VB OCX controls. | | See if that helps. | | "Abhishek" <u***@server.com> wrote in message So how exactly are you changing your images? You have to store them news:i5ovvg$2qb$1@speranza.aioe.org... :> error message when you run a Visual Basic application that contains an : > ImageList control : : there is no control or code at all on/in the form. someplace. Maybe it's time to see the offending code, cause this guessing game isn't really working out. There is no 'offending' code, for that matter any code at all. there is no
control on form, and i am not doing anything at all in taht app, not even a sinlge msgbox. just set the icon to the form at design time and run it under restricted rights, read my 1st post, I have explain how to reproduce it. Show quoteHide quote "Kevin Provance" <k@p.c> wrote in message news:i5p6am$ooe$1@news.eternal-september.org... | | "Abhishek" <u***@server.com> wrote in message | news:i5ovvg$2qb$1@speranza.aioe.org... | :> error message when you run a Visual Basic application that contains an | : > ImageList control | : | : there is no control or code at all on/in the form. | | So how exactly are you changing your images? You have to store them | someplace. Maybe it's time to see the offending code, cause this guessing | game isn't really working out. | "Abhishek" <u***@server.com> wrote in message I did read your first post. How am I supposed to reproduce that on my news:i5q2d7$bvc$1@speranza.aioe.org... : There is no 'offending' code, for that matter any code at all. there is no : control on form, and i am not doing anything at all in taht app, not even a : sinlge msgbox. just set the icon to the form at design time and run it under : restricted rights, read my 1st post, I have explain how to reproduce it. computer? Tell me exactly what I need to do, step by step to make this happen. Send me the icon you are using (or post it here). If I can make it happen on my computer, than I can better understand what is happening. Only on 2000, XP
1. make a vb6 project 2. set the form icon at design time, use any icon. 3. make exe. 4. right click exe > run as > current user > check 'protect my computer and data...' > ok 5. Error Show quoteHide quote "Kevin Provance" <k@p.c> wrote in message news:i5q3k3$2se$1@news.eternal-september.org... | | "Abhishek" <u***@server.com> wrote in message | news:i5q2d7$bvc$1@speranza.aioe.org... | : There is no 'offending' code, for that matter any code at all. there is no | : control on form, and i am not doing anything at all in taht app, not even | a | : sinlge msgbox. just set the icon to the form at design time and run it | under | : restricted rights, read my 1st post, I have explain how to reproduce it. | | I did read your first post. How am I supposed to reproduce that on my | computer? | | Tell me exactly what I need to do, step by step to make this happen. Send | me the icon you are using (or post it here). If I can make it happen on my | computer, than I can better understand what is happening. | I tried your instructions and it errored out. I tried not adding any icon
and it errored out with a different message "Unexpected error; quitting.". Then I tried it with some of my VB program that use icons and they loaded no problem. You want to know what the difference is? My projects use a Sub Main. I don't start them as a Form. So it seems another option for you is to use a Sub Main to load your form at startup. - Kev Show quoteHide quote "Abhishek" <u***@server.com> wrote in message news:i5q4fg$e3q$1@speranza.aioe.org... : Only on 2000, XP : : 1. make a vb6 project : 2. set the form icon at design time, use any icon. : 3. make exe. : 4. right click exe > run as > current user > check 'protect my computer and : data...' > ok : 5. Error : : "Kevin Provance" <k@p.c> wrote in message : news:i5q3k3$2se$1@news.eternal-september.org... : | : | "Abhishek" <u***@server.com> wrote in message : | news:i5q2d7$bvc$1@speranza.aioe.org... : | : There is no 'offending' code, for that matter any code at all. there is : no : | : control on form, and i am not doing anything at all in taht app, not : even : | a : | : sinlge msgbox. just set the icon to the form at design time and run it : | under : | : restricted rights, read my 1st post, I have explain how to reproduce it. : | : | I did read your first post. How am I supposed to reproduce that on my : | computer? : | : | Tell me exactly what I need to do, step by step to make this happen. Send : | me the icon you are using (or post it here). If I can make it happen on : my : | computer, than I can better understand what is happening. : | : : "Kevin Provance" <k@p.c> wrote in message I tried this in a new project, and whether I use Sub Main() or not, I get news:i5q66s$c86$1@news.eternal-september.org... >I tried your instructions and it errored out. I tried not adding any icon > and it errored out with a different message "Unexpected error; quitting.". > Then I tried it with some of my VB program that use icons and they loaded > no > problem. > > You want to know what the difference is? My projects use a Sub Main. I > don't start them as a Form. So it seems another option for you is to use > a > Sub Main to load your form at startup. the Invalid Picture error. I already set the startup type to Sub Main, and selected the Icon source from Form1. Here is what I have in Module1: Option Explicit Public Sub Main() Form1.Show End Sub I used the following icon: C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Computer\CDROM01.ICO I tried digitally sign the EXE, but got the same error. Adding the EXE to "Data Execution Prevention" exclusion list doesn't make any difference. Yes, same here. whether i use Sub Main or not, it gives me error.
Show quoteHide quote "Nobody" <nob***@nobody.com> wrote in message news:i5q9ac$k6h$1@speranza.aioe.org... | "Kevin Provance" <k@p.c> wrote in message | news:i5q66s$c86$1@news.eternal-september.org... | >I tried your instructions and it errored out. I tried not adding any icon | > and it errored out with a different message "Unexpected error; quitting.". | > Then I tried it with some of my VB program that use icons and they loaded | > no | > problem. | > | > You want to know what the difference is? My projects use a Sub Main. I | > don't start them as a Form. So it seems another option for you is to use | > a | > Sub Main to load your form at startup. | | I tried this in a new project, and whether I use Sub Main() or not, I get | the Invalid Picture error. I already set the startup type to Sub Main, and | selected the Icon source from Form1. Here is what I have in Module1: | | Option Explicit | | Public Sub Main() | Form1.Show | End Sub | | I used the following icon: | | C:\Program Files\Microsoft Visual | Studio\Common\Graphics\Icons\Computer\CDROM01.ICO | | I tried digitally sign the EXE, but got the same error. Adding the EXE to | "Data Execution Prevention" exclusion list doesn't make any difference. | | I forgot to say that I am using XP+SP2 without the latest updates(automatic
updates are off), and VB6+SP5 with SP6 runtime. msvbvm60.dll version is 6.0.97.82. Adding error handler to sub main doent solves the problem either, not even
on error resume next Show quoteHide quote "Nobody" <nob***@nobody.com> wrote in message news:i5q9ac$k6h$1@speranza.aioe.org... | "Kevin Provance" <k@p.c> wrote in message | news:i5q66s$c86$1@news.eternal-september.org... I think I found the reason, but I am not 100% sure. MSKB article 964421
suggests that VB uses the TEMP folder. That article is not for VB, but perhaps for VBA. Error 481: Invalid Picture http://support.microsoft.com/kb/964421 The article below explains the implications of enabling "Protect my computer and data from unauthorized program activity". One of them is running the application with a restricted token, which means the user's profile, including the TEMP path are not accessible. Running restricted -- What does the "protect my computer" option mean? http://blogs.msdn.com/b/aaron_margosis/archive/2004/09/10/227727.aspx More search results: http://social.msdn.microsoft.com/Search/en-us?query=%22Protect+my+computer+and+data+from+unauthorized+program+activity%22 "Abhishek" <u***@server.com> wrote in message I agree. I was just pointing out a way to avoid the "default icon for the news:i5oqdr$pdg$1@speranza.aioe.org... > yep, the restrictions are severe but the invalid picture > error should [not] occur since we are not doing anything. compiled exe" problem that your own workaround of setting the Form's icon at runtime had. Using both workarounds together solves the problem, although it is of course still just a workaround of an apparent bug in VB. But then we've lived with workarounds of various kinds for years, and they do work ;-) Mike I was able to reproduce this on Windows 2000. it is happening on Windows
2000 and XP only. the 'RunAs' verb is used in vista and above to invoke the UAC dialog and doesn't seems to cause any problem This is the error I got on Windows 2000. --------------------------- Access to the specified device, path, or file is denied. --------------------------- Make a shortcut of your app, properties > check 'run as different user' > ok then open the shortcut, it will show you the user logon dialog, enter your user/pass and then it will display the error. Happens even if I copy the file to temp folder and run it. tested it with guest account, standard account and restricted account. its more serious than XP, at least on XP we are able to lunch our app with different user, even if its standard user, but not on 2000. the app run *fine* on both 2000 and XP if i login to guest account but i can not run the app as different user. the only workaround I found is that dont associate icon at design time and set icons at runtime from resource. Show quoteHide quote "Mike Williams" <M***@WhiskyAndCoke.com> wrote in message news:i5ojbj$duo$1@speranza.aioe.org... | "Abhishek" <u***@server.com> wrote in message | news:i5o9ir$tam$1@speranza.aioe.org... On 01/09/2010 12:41, Abhishek wrote:
> Hi, Where are you running this from?> > I have Win XP, when I run my application using right click> run as> check > 'protect my computer and data from unauthorized program activity' I get an > error > > Run-time error '481': Invalid picture > > Why this is happening? and any fixes for that? Apparently that option also restricts access to the user profile including My documents. If the EXE is in there, it will load, try and access its own data in the executable and fail as it can't be found. Does it then work if you try and run it from a shared/common location? -- Dee Earley (dee.ear***@icode.co.uk) i-Catcher Development Team iCode Systems (Replies direct to my email address will be ignored. Please reply to the group.) |
|||||||||||||||||||||||