Solved

VB6 ImageList control 'Invalid File Reference' errors when loading

Posted on 2006-07-10
10
1,064 Views
Last Modified: 2012-08-14
Howdy

I have a VB6 form with an ImageList control, and am using Source Safe.  When I open one of my forms it loads fine, except that in the ImageList control all images are black, which means all images on a toolbar are black.    

Also, loading the form creates a log file that has multiple lines like....

Line 330: Property Picture in ListImage22 had an invalid file reference.
Line 334: Property Picture in ListImage23 had an invalid file reference.
Line 338: Property Picture in ListImage24 had an invalid file reference.
Line 342: Property Picture in ListImage25 had an invalid file reference.
etc. etc.

Problem is, when I copy/paste the MyFormName.frm into MyFormName.txt and read the Line 330, Line 334's, etc. they have GUIDs instead of path/file's, and when I tried to scan a couple of the GUIDs it came up empty.

My frm file does have an frx file of the same name, which I've read stores all the graphics of an .frm file, but from what I can tell it is not reading them.

Has anyone had a situation like this, and succesfully restored images in an ImageList control?

Thanks in advance.
-Jim
0
Comment
Question by:Jim Horn
[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
  • 5
  • 3
  • 2
10 Comments
 
LVL 19

Assisted Solution

by:BrianGEFF719
BrianGEFF719 earned 200 total points
ID: 17077075
Hi Jim,

Is there any way you can get to the computer that first developed this project and try searching its registry for the GUIDs?

Brian
0
 
LVL 9

Accepted Solution

by:
justchat_1 earned 300 total points
ID: 17077674
The images used are stored in a different location then what the project file has stored...would it be possible to re-add the images?
0
 
LVL 19

Assisted Solution

by:BrianGEFF719
BrianGEFF719 earned 200 total points
ID: 17077704
Yes, add the images again, but pay close attention and make sure the indexes are all the same! This is very important, just make sure you add them in the same order they were in before.

Also, make sure you remove all the invalid images before re-adding the images.

-Brian
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 17077708
sorry I answered justchat_1's question about "would it be possible to re-add the images"

lol
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17077790
lol I should have made my comment more clear...
0
 
LVL 66

Author Comment

by:Jim Horn
ID: 17082069
Thanks for your comments guys.

I renamed frmMain.frm as frmMain.txt, and below is a snippet...    

    Begin MSComctlLib.Toolbar tbToolbar
      ImageList       =   "imlIcons"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
         NumButtons      =   29
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
            Key             =   "New"
            Description     =   "New"
            Object.ToolTipText     =   "New"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
            Key             =   "Open"
            Description     =   "Search"
            Object.ToolTipText     =   "Open"
            ImageIndex      =   2
         EndProperty

I'm on the original developer's pc (or so I think, app was first created four years ago and I've been here nine months), and did a registry search for the GUID listed, with zero results.

I also searched via Resource Editor for any .res files with images, no love there either.

With 20 images, some of them I can't find as .bmp's on my pc, I wanted to explore all possibilities of restoring the file before creating a new ImageList and populating images from scratch (with the help of Easy Icon Maker and screen shots), but it looks like that's what I'll be doing.
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17084504
Do the images show up on the developers computer? If they do we can extract them...
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17084509
Or if not and you have a compiled version use resource hacker to extract the images...
0
 
LVL 66

Author Comment

by:Jim Horn
ID: 17084694
The images were not on teh developer's computer.  

I ended up rebuilding it from scratch.  Fortunately most of the images were Windows XP/Office standard icons, and were able to just copy/paste into one folder, rename, then add to image control.  The yellow banana button, however, had to be changed, as I couldn't find a yellow banana image anywhere.

The toolbar on my fom also had to be re-associated with the images in the ImageList control, which meant listing the Image numbers in the Image controls, and typing them in to the Toolbar property dialog, Image textbox.

I'll be checking this back into VSS, but also keeping an extra copy out on the network in case the frm-frx relationship breaks again.

Thanks guys.
-Jim
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17085185
no problem...if you have the banana image in one of your programs give resource hacker a try..
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

691 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