?
Solved

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

Posted on 2009-07-04
20
Medium Priority
?
1,397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
20 Comments
 
LVL 4

Accepted Solution

by:
nasserd earned 300 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 300 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 22

Assisted Solution

by:danaseaman
danaseaman earned 900 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 900 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
 
LVL 22

Assisted Solution

by:danaseaman
danaseaman earned 900 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 3 hours left to enroll

764 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