This Add-In is mainly intended for large projects, maybe old or inherited projects that you need to renew or rework, and you have to find what it has and where.
It deals with design time issues, not with source code. For source code I suggest LaVolpe's Project Scanner.
How to start with it:
Download the source code of the Add-In, compile it with an elevated IDE and close the IDE.
Then open the IDE again with the project you want to work on.
Go to the Add-Ins menu and select Project Examiner.
Here there are some screen shots:
There are several tabs. Their functions are:
Scan:
Performs the scan of the project to find what it has.
This must be done before anything else.
Dependencies:
Shows what control types the program uses and where they are.
There are two option buttons at the bottom to select to view them grouped by dependency or by form.
Strings:
Shows what controls and which properties has strings stored at design time.
This can be useful if you are translating a program and need to find where are the design-time strings that need translation.
Fonts:
This tab shows the fonts that the program uses and where.
There are two option buttons at the bottom to select to view them grouped by font or by form.
Find controls:
Find the controls that meet certain criteria. The condition is the value of a property ("=", "<>" ">", etc.).
If works with numeric values and also with strings.
Replace fonts:
There you can select what font to replace and with which one.
Copy controls:
Copy a control that is on a form to all the others (and/or to usercontrols) or some of them.
Notes:
Image handling seems not to be supported by the Add-in environment.
Make a backup copy of your project before doing anything (if you don't already have one), that is a good practice.
Changelog:
Code:
2021-01-27 fixed bug in the font replacement utility
2021-01-27 fixed bug that happened when compiled
2021-01-27 added better support for running on project groups
2021-01-26 bug fix at the 'Find controls' tab, now it allows to compare to empty strings ("")
2021-01-19 added more options the the 'Find controls' tab
2021-01-18 added some fixes for running at non-integer TwipsPerPixels DPI settings.
2021-01-17 bug fix: in some situations VBComponent.Reload raised an error.
2020-10-04
The Copy to Clipboard feature now adds tab characters instead of spaces to facilitate pasting to Excel.
Some forms can be flagged unsaved (or changed) just opening them (without making any changes to them). It can be due to an UserControl or third party control. The Add-in opens all the forms, and in the previous version these forms were flagged as unsaved. Now that is fixed in this version, all forms remain in their original "saved/unsaved" state.
Designer windows remain in their original state (not closed if they were already open).
2020-10-04
The compare criteria in the Find tab now ignored the "&" symbol (that can be common on Captions to set the accelerator key)
FontName properties not added to the String list anymore.
Out of memory bug fixed. The designer windows were opened -but not set visible- in the scan and not closed after that, causing an out of memory error on very large projects.
2020-10-03: First version
Last edited by Eduardo-; Jan 28th, 2021 at 07:58 PM.
Seems intersting (looking the code), but no way to compile it
"Compile Error Procedure declaration does not match description or event or procedure having the same name"
on
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
and
Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
NB : After closed and several attempts, I made it run.
now scanning a big project to look the result
Last edited by Thierry69; Oct 4th, 2020 at 12:47 AM.
Seems intersting (looking the code), but no way to compile it
"Compile Error Procedure declaration does not match description or event or procedure having the same name"
on
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
and
Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
NB : After closed and several attempts, I made it run.
now scanning a big project to look the result
That was probably about a different Office version that you have installed, but not sure.
Accessing the Designer might fail for a form which hosts a user-control from the same project (or different project in the current project group).
Manually opening the designer pre-compiles the user-control and running the whole project (Ctrl+F5) compiles all the forms. Still accessing the Designer might fail with out-of-memory and bring down the IDE in the process.
Accessing the Designer might fail for a form which hosts a user-control from the same project (or different project in the current project group).
But I tested it with several projects that had usercontrols and I didn't get that error.
Originally Posted by wqweto
Manually opening the designer pre-compiles the user-control and running the whole project (Ctrl+F5) compiles all the forms. Still accessing the Designer might fail with out-of-memory and bring down the IDE in the process.
cheers,
</wqw>
Could you or someone else post a test project where the error happens to study it?
Extracting string (I found 2 labels that where not translated),
I don't understand what you mean.
Originally Posted by Thierry69
gives also strings for fonts:
FontName Property: "Segoe UI"
Yes, it give all properties that return strings.
I already excluded "Name", now I realize that I have to also exclude "FontName" (and perhaps some other properties too).
Originally Posted by Thierry69
Of course
I am 100% up to date, and it is a commercial product (quite big, millions of lines)
The designer for forms remains opened
So when too much forms are in memory -> Out of memory
So you need to close the designer at the end of your For Next :
If (iComp.Type = vbext_ct_VBForm) Then
iComp.DesignerWindow.Close
End If
Set iComp = Nothing
Still have 1 small problem, it hangs at some times, but when running in the IDE, a resume is good enough
I tried to add some delay, but no way
As I need to go, I can't look anymore for the moment
1) The designers now are unloaded so the out of memory error should have gone.
2) The strings for FontName properties are now excluded.
3) The find tool now ignores the "&" that may be in the captions.
Here on a big project it works for a few forms and then just says "Canceled" with no more info on whatever happened.
Not sure if I can reproduce it as the add-in works on smaller project jus' fine. Try to instrument more error info when "Canceled" if you want me to run scan a few more times.
Here on a big project it works for a few forms and then just says "Canceled" with no more info on whatever happened.
Not sure if I can reproduce it as the add-in works on smaller project jus' fine. Try to instrument more error info when "Canceled" if you want me to run scan a few more times.
cheers,
</wqw>
That is intended to happen when you for example, close the project while the scan is running. In that case it does not matter the specific error (that can be any when accesing an object that it doesn't exist any more).
But if you are getting it in a normal situation that's not normal or intended.
Please go to Private Sub Scan and replace the 8 occurrences in that procedure of On Error GoTo ErrorExit with On Error GoTo 0, run the add-in on the IDE, scan the problematic project and report what error is happening and where. Thank you.
Last edited by Eduardo-; Oct 4th, 2020 at 09:11 AM.
I suppose he is using the updated version. But yes, if he is using the original version it can be that very probably.
BTW, was the problem fixed in the updated version? (I guess it was, but better to test with the project that was giving the error).
Last edited by Eduardo-; Oct 4th, 2020 at 10:08 AM.
wqweto, during the enumaeation of forms, forms are loaded, but not unloaded.
So in big projects, an Out of Memory occurs
This is the reason of my modification
2020-10-04c: Update:
The Copy to Clipboard feature now adds tab characters instead of spaces to facilitate pasting to Excel.
Some forms can be flagged unsaved (or changed) just opening them (without making any changes to them). It can be due to an UserControl or third party control. The Add-in opens all the forms, and in the previous version these forms were flagged as unsaved. Now that is fixed in this version, all forms remain in their original "saved/unsaved" state.
Designer windows remain in their original state (not closed if they were already open).
2021-01-18 added some fixes for running at non-integer TwipsPerPixels DPI settings.
2021-01-17 bug fix: in some situations VBComponent.Reload raised an error.
Last edited by Eduardo-; Jan 19th, 2021 at 11:49 AM.
2021-01-19 added more options the the 'Find controls' tab
Before the only option was to find controls (of a certain type) with some property value.
Now added two more options: list all controls of the type, and compare the value of a property to another property.
Is there a VB6 version of the operation github upload download synchronization project command?
Make a large-scale VB6 add in, open source project, some functions are independent, some are integrated together, later can develop VfB IDE (visual freebasic) project source code management plug-in.
2021-01-27 fixed bug in the font replacement utility
2021-01-27 fixed bug that happened when compiled
2021-01-27 added better support for running on project groups
I'm just now finding this. I haven't really explored it in depth, but it looks like good work.
Thanks for referencing it in my font replacer thread. Rather than do anymore work on that thing, I think I'll just start referring people over here.
Best Regards,
Elroy
Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.
I'm just now finding this. I haven't really explored it in depth, but it looks like good work.
Thanks for referencing it in my font replacer thread. Rather than do anymore work on that thing, I think I'll just start referring people over here.
Best Regards,
Elroy
OK Elroy.
I used it to improve a large program, to find what I had and where and to change fonts.
Perhaps I took the same time to do this than if I manually had done the changes, but it was more fun (and now it can be used with any project).
Thanks Eduardo, thanks Elroy. Your AddIns are wonderful.
They will help me with the graphic restyling of the projects.
I'll have to find the time to study them. I need to change other properties of the controls.
many thanks