Solved

Insert an Icon in my VB6 application and gives "unexpected error"

Posted on 2009-07-04
20
1,142 Views
Last Modified: 2013-11-26
I have a VB6 apps and tried to insert an Icon via the properties window and got  "unexpected error".

I converted the Icon from PNG format.  Prior conversion the PNG properties is:

24-bit RGB color
Width 75 pixels (0.50 inches)
Height 75 pixels (0.50 inches)
Resolution 150
Image size on disk 16kb

0
Comment
Question by:rayluvs
20 Comments
 
LVL 4

Accepted Solution

by:
nasserd earned 100 total points
ID: 24778334
The source image does not matter... it is the resulting icon image which is causing the error to be thrown (of course, "unexpected error" is not a helpful error message).

Make sure the latest service packs are installed and icon support is typically limited to the compatibility between VB IDE and Windows.

Compatible ICO's are typically 8 bit images you can freely edit in MS Paint.
0
 
LVL 4

Assisted Solution

by:stevepicks
stevepicks earned 100 total points
ID: 24779309
0
 

Author Comment

by:rayluvs
ID: 24781040
Unfortunately non worked.  

I found this site http://converticon.com/ to also convert and nothing.  I used an icon from stevepicks link and copied my image there and converted back to ICO, nothing.

Am I missing something?
0
 
LVL 22

Assisted Solution

by:danaseaman
danaseaman earned 300 total points
ID: 24781410
Can you attach the png and ico files so that we can take a look?
Here is an example of how to attach an Ico (including 32-bit) to your project:

Providing a proper VB Application Icon, Including Large Icons and 32-Bit Alpha Image
http://www.vbaccelerator.com/home/vb/tips/setting_the_app_icon_correctly/article.asp

Note that 32-bit icons will not display properly in IDE but will when compiled to Exe.
0
 

Author Comment

by:rayluvs
ID: 24783453
Attached is the JPG we want to change.  Unfortunately, the upload does not permit me to upload ICO files.  So here is the JPG version
oS.Icon.jpg
0
 

Author Comment

by:rayluvs
ID: 24783455
I went thu your link, its kinda complicate for just setting the Icon, but we'll keep trying
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 24783608
Converted Jpg to 24-bit Ico with Axialis and it loads in Vb6 Form OK here.
Download Ico here:
http://www.mediafire.com/file/ljj3cdmnunw/oS.ico

0
 

Author Comment

by:rayluvs
ID: 24783619
Error: Invalid Picture (and I using a fresh new project just in case)

The thing is we did this a couple of month back with no problem....
0
 
LVL 22

Assisted Solution

by:danaseaman
danaseaman earned 300 total points
ID: 24784652
What OS are you using and what is OS Color depth?
Here is same Icon as 8-bit (256 Color).
http://www.mediafire.com/file/yjjmncmmhmn/oS256Colors.ico


FormOSIcon256.png
0
 

Author Comment

by:rayluvs
ID: 24794829
Windows XP Pro Sp2

I download yout ICO, still "Invalid Picture"



0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Assisted Solution

by:danaseaman
danaseaman earned 300 total points
ID: 24794979
Definitely something wrong with your system.
Try installing Vb6-Sp6 to see if that helps:
Service Pack 6 for Visual Basic 6.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=9EF9BF70-DFE1-42A1-A4C8-39718C7E381D&displaylang=en


0
 

Author Comment

by:rayluvs
ID: 24798226
I already have the SP6

Yes thats what I think.  But the thing is that current ICO I can import, but ones I create, doesnt' work.

So is something I do
0
 

Author Comment

by:rayluvs
ID: 24798230
prior to
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 24798888
The 2 icons I sent were made with with Axialis so I am sure they are OK and they both work  on my machine. I think there is something wrong with your Vb6 installation. Wouldn't hurt to try to reinstall SP6 to see if that corrects the problem. Reinstalling Vb6 from scratch is also fairly quick.  
0
 

Author Comment

by:rayluvs
ID: 24798970
the thing is that present ICO worked

Let me send you one that works and can u review it to see its structure?

I cant seem to send the ICO....is there way I can send it to u?
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 24799034
If the Icons I sent don't work there then there must be something wrong with your Vb6 installation, otherwise why are they working here.
0
 

Author Comment

by:rayluvs
ID: 24799321
Ok...let me try reinstall SP6
0
 

Author Comment

by:rayluvs
ID: 24807476
Its not SP6.  I found out why my previous programmer icon worked.  He used an application called "Any to Icon" and I ran it and it worked excellently.
0
 

Author Comment

by:rayluvs
ID: 24807497
I don't how this works, but you've been very patience with us and helped a lot, so we'll give you the points.
0
 

Author Closing Comment

by:rayluvs
ID: 31599839
Thanx to all
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now