Solved

VB6 ImageList control 'Invalid File Reference' errors when loading

Posted on 2006-07-10
10
1,015 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Script Host failed (Access is denied.) error 6 153
Access query that references subform 5 47
MsgBox 4 62
MS Access 03, TransferText, decimal places 8 73
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

832 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