2
votes

I have a VB6 project for a legacy application with a number of forms that have a List View control. I recently opened the latest version of the project and received an error message for each form with a List View. When I checked the log files, all of them were basically the same: "Line 74: Class MSComctlLib.ListView of control lvwListItems was not a loaded control class." Only the line number was different.

I looked at the references and components and noticed that Microsoft Windows Common Controls 6.0 (SP6) was not checked as it should have been. I checked it and tried opening one of the forms. The form loaded but it now has a Picture Box where the List View should be. Another form had the List View missing entirely - just a blank space where it should have been. I opened the previous version of the project; it opened without errors and the component was checked. When I opened the form it had the List View control properly loaded.

Can I get the control back in the current version without rebuilding it from scratch? It would be a major pain to have to do this. I'm afraid to check the component and save the project for fear of losing the control on all the forms.

System information: Windows 7 32-bit, VB6 Professional. All the common controls are in the correct location (C:\Windows\system32) and are registered, as proved by the fact that the previous version opens and has all the correct references and controls.

The current version lists all the controls in the same location as the previous version, the component just wasn't checked for some reason, and checking it doesn't bring the controls back. What can I do?

1

1 Answers

2
votes

The VBP is a text file. I would suggest comparing the current version of the VBP with the previous version, and copying across the line which references Microsoft Windows Common Controls 6.0 (SP6).

The line will probably look something like this (perhaps the GUID string, version number, and filename may differ).

Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX

By the way, are you using version control for this project? Subversion or similar? If not, I highly recommend you do.