Jag fasar inför varje datorbyte, men ibland behöver man byta. Naturligtvis stöter jag på problem med Visual Basic 5. Jag kan inte ladda de projekt som använder Microsoft Windows Common Controls 5.0. De projekt som inte använder några extrakontroller går att ladda. Men jag är en flitig användare av Common Controls (listview och progressbar, bl.a), och när jag laddar ett sådant projekt får jag detta felmeddelande: Testa regsvr32. Hej, tack för svaret. Jag tror dock att jag löste det. Jag jämförde filversionerna mellan datorerna, och den gamla datorn hade nyare ocx-filer, hur nu det gått till. Jag provade att flytta över dem till nya datorn, men det hjälpte inte. Då provade jag att installera ett av mina egna program på nya datorn... och då verkade det släppa. Det ser ut att fungera nu.Datorbyte: kan inte ladda eget projekt - comctl32.ocx
"d:\nytto\vb5\egna_projekt\Projekt1\comctl32.ocx could not be loaded--Continue loading projekt?"
Varför VB5 tror att comctl32.ocx ska finnas i samma mapp som projektet har jag ingen aning om. Om jag förtsätter att ladda projektet i alla fall, och väl inne försöker ladda Common Controls, står samma ökväg där, och den kan inte användas, eftersom den inte finns där.
I en av logfilerna står bl.a:
"Line 278: Class ComctlLib.ListView of control ListView1 was not a loaded control class."
Om jag startar ett nytt projekt kan jag ladda Common Controls. Inga problem.
Jag har också provat att kopiera in comctl32.ocx till projektmappen, men det fungerar i alla fall inte.
Någon som vet vad jag borde ta mig till?Sv: Datorbyte: kan inte ladda eget projekt - comctl32.ocx
Skriv (i kör rutan): regsvr32 och dra filen och släpp den i textrutan.Sv:Datorbyte: kan inte ladda eget projekt - comctl32.ocx
Dessutom hittade jag en intressant text om just detta. Jag tar mig friheten att klistra in den:
--
http://www.vb-helper.com/tips5.htm
Dead OCXs
By Barry Traver
Recently in the Usenet newsgroup comp.lang.basic.visual.misc, more than one Visual Basic 5 user has reported the same problem: Suddenly, for no apparent reason Visual Basic 5 refuses to load in COMDLG32.OCX, COMCTL32.OCX, or COMCT232.OCX. Instead the error message "'' could not be loaded" is given (even though such files are present in C:\WINDOWS\SYSTEM and VB 5 does know the correct names of the files!).
I myself experienced that problem, which meant that I was not able to use for several weeks in VB 5 the common dialog control (that's six controls right there!), toolbar, status bar, image list, progress bar, tree view, list view, slider, etc. . I'm writing this so that other VB 5 programmers will know what to do if they encounter the problem.
Here's an important paragraph from Microsoft Knowledge Base article Q217017, which can be found at http://support.microsoft.com/support/kb/articles/q217/0/17.asp, concerning the "'' could not be loaded" message:
This error message occurs when you install a newer version of an ActiveX control, uninstall it, and then install an older version of the same ActiveX control. The registry key for the newer version of the ActiveX control remains in the registry and Visual Basic 5.0 is now trying to use that registry key.
This could easily happen, for example, if you install (as I did) a recent shareware program and later uninstall it. The key point is that although the earlier version of the OCX is restored, the Windows registry still points to the later version of the OCX (and since it is no longer there, VB 5 is unable to load it).
To fix the problem, the Knowledge Base advises using RegClean, making the important point, "RegClean will only be effective if Comctl32.ocx is deleted from the system before running RegClean." (Although not mentioned by the article, it appears that comdlg32.ocx and comct232.ocx should also be temporarily deleted before running RegClean.)
For details on using RegClean, see Knowledge Base article Q147769, "RegClean 4.1a Description and General Issues," which can be found at http://support.microsoft.com/support/kb/articles/Q147/7/69.asp. The RegClean utility itself can be downloaded from the Microsoft site at http://support.microsoft.com/download/support/mslfiles/RegClean.exe.
Here are the specific steps I took to solve the problem:
1. I downloaded RegClean from the Microsoft site.
2. I sent the three com*32.ocx files to the Recycle bin.
3. I unzipped and ran RegClean to repair the registry.
4. I restored the three com*32.ocx files from the Recycle bin.
5. I used Regsvr32.exe to register the three com*32.ocx files.
6. I tested out VB to confirm that things were indeed working again.
7. I reinstalled the Visual Basic 5 service pack 3 (a good idea after you use RegClean).
IMPORTANT LESSON TO BE LEARNED: If you install, say, a shareware program and then uninstall the program, it may mess up the registry for VB 5! That's because when you install the program, it may replace an older OCX with a newer version, and when you uninstall it, it will indeed replace the newer OCX with the older version, BUT IT DOESN'T FIX THE REGISTRY .