Solved

VB6 ImageList control 'Invalid File Reference' errors when loading

Posted on 2006-07-10
10
1,022 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
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 65

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 65

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 73
Notepad++ how to remove delimiter : from beggning of the line? 3 114
SLMGR Switches Are Not Working On KMS Host 3 114
Set WorkSheet  not Working 9 42
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

830 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