[RESOLVED] Reloading missing components in old project
Hi,
I have a project that I haven't looked at for years and need to modify and need some help getting it working.
On opening it I've found that I needed to reload Microsoft Windows Common Controls-2 component.
After doing that the next error is that my toolbar control is just a picturebox and I get a compile error saying Method or data member not found.
Is there any way of getting the original toolbar working again?
Re: Reloading missing components in old project
Quote:
Originally Posted by
sgrya1
After doing that the next error is that my toolbar control is just a picturebox and I get a compile error saying Method or data member not found.
Could you post a screenshot, and a code snippet showing where the app throws the error
Spoo
1 Attachment(s)
Re: Reloading missing components in old project
Attachment 153189
This is the line that is throwing the error:
Code:
MDI.tbToolBar.Buttons("RCPerims").Value = 1
I guess without the components included when I open the project these controls are converted to PictureBoxes. I don't know how to add the components before opening the project.
Re: Reloading missing components in old project
When I load the project I get an error saying "Errors during load. Refer ...MDIForm1.log for details"
Line 40: Class MSComctlLib.ImageList of control imlToolbarIcons was not a loaded control class.
Line 86: Class MSComctlLib.Toolbar of control tbToolBar was not a loaded control class.
Line 43: The property name _ExtentX in imlToolbarIcons is invalid.
Line 44: The property name _ExtentY in imlToolbarIcons is invalid.
Line 46: The property name ImageWidth in imlToolbarIcons is invalid.
Line 47: The property name ImageHeight in imlToolbarIcons is invalid.
Line 48: The property name MaskColor in imlToolbarIcons is invalid.
Line 49: The property name _Version in imlToolbarIcons is invalid.
Line 84: The property name Images in imlToolbarIcons is invalid.
Line 93: The property name _ExtentX in tbToolBar is invalid.
Line 94: The property name _ExtentY in tbToolBar is invalid.
Line 95: The property name ButtonWidth in tbToolBar is invalid.
Line 96: The property name ButtonHeight in tbToolBar is invalid.
Line 98: The property name ImageList in tbToolBar is invalid.
Line 99: The property name _Version in tbToolBar is invalid.
Line 148: The property name Buttons in tbToolBar is invalid.
The component is possibly registered but using a different name?
I don't really know what I'm talking about. Just taking wild guesses.
Re: Reloading missing components in old project
I worked it out after a bit of searching.
I created a fresh VB project, added the missing components and saved it.
I opened the project's .vbp file and copied the missing component references into my project's .vbp file.
Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX
Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx
Re: [RESOLVED] Reloading missing components in old project
You made the mistake of saving the project when it couldn't find the components.
When I see that error I definitely don't save the project as I don't want to loose those references, but as you found it is easy enough to add them back manually.
Re: [RESOLVED] Reloading missing components in old project
I did save it, came to that realization and then there was a panic search for a backup.
Luckily still had one.