Solved

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

Posted on 2009-07-04
20
1,113 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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

14 Experts available now in Live!

Get 1:1 Help Now