Solved

VB6 ImageList control 'Invalid File Reference' errors when loading

Posted on 2006-07-10
10
984 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
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
Comment Utility
lol I should have made my comment more clear...
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 65

Author Comment

by:Jim Horn
Comment Utility
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
Comment Utility
Do the images show up on the developers computer? If they do we can extract them...
0
 
LVL 9

Expert Comment

by:justchat_1
Comment Utility
Or if not and you have a compiled version use resource hacker to extract the images...
0
 
LVL 65

Author Comment

by:Jim Horn
Comment Utility
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
Comment Utility
no problem...if you have the banana image in one of your programs give resource hacker a try..
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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 …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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