-
Oct 3rd, 2020, 07:46 PM
#1
[VB6 Add-In] Project Examiner
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-11-28 some improvements made.
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
Download from GitHub.
Last edited by Eduardo-; Dec 7th, 2021 at 02:14 PM.
-
Oct 4th, 2020, 12:30 AM
#2
Re: [VB6 Add-In] Project Examiner
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.
-
Oct 4th, 2020, 01:00 AM
#3
Re: [VB6 Add-In] Project Examiner
I had a out of memory on this line :
Set iDes = iComp.Designer
than it corrupted the form (I had a backup)
NB : It is a big project with 236 forms & 26 UC
-
Oct 4th, 2020, 02:18 AM
#4
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
I had a out of memory on this line :
Set iDes = iComp.Designer
than it corrupted the form (I had a backup)
NB : It is a big project with 236 forms & 26 UC
iDes is declared As Object.
Try declaring it As VBForm.
Also, try before the line:
Set iDes = iComp.Designer
Code:
Set iDes = Nothing
Set iDes = iComp.Designer
-
Oct 4th, 2020, 02:22 AM
#5
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
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.
-
Oct 4th, 2020, 02:26 AM
#6
Re: [VB6 Add-In] Project Examiner
Same problem.
Always on the same form, the 26's form
-
Oct 4th, 2020, 02:29 AM
#7
Re: [VB6 Add-In] Project Examiner
Originally Posted by Eduardo-
That was probably about a different Office version that you have installed, but not sure.
I have found the reason.
I just had to open the main designer to make it work (just to let you know)
-
Oct 4th, 2020, 02:36 AM
#8
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
I have found the reason.
I just had to open the main designer to make it work (just to let you know)
What is the main designer? Connect.dsr?
-
Oct 4th, 2020, 02:38 AM
#9
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
Same problem.
Always on the same form, the 26's form
I don't know, perhaps it is a RAM limitation or some resource limitation and that form in particular has too many controls.
You are an Add-In professional, please help! (LOL).
-
Oct 4th, 2020, 02:40 AM
#10
Re: [VB6 Add-In] Project Examiner
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.
cheers,
</wqw>
-
Oct 4th, 2020, 02:45 AM
#11
Re: [VB6 Add-In] Project Examiner
No problem of ram (32gb)
I'll try to figure out
-
Oct 4th, 2020, 02:49 AM
#12
Re: [VB6 Add-In] Project Examiner
Originally Posted by wqweto
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?
-
Oct 4th, 2020, 03:37 AM
#13
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
No problem of ram (32gb)
I'll try to figure out
Just a shot in the dark: do you have SP6 installed?
(I guess you do, but just to be sure)
-
Oct 4th, 2020, 03:42 AM
#14
Re: [VB6 Add-In] Project Examiner
I modified the addin just tohandle UC.
I worked
Unfortunately I have exactly 26 UC (it crashed on the 26's form)
I still investigate
Some comments :
Extracting string (I found 2 labels that where not translated), gives also strings for fonts:
FontName Property: "Segoe UI"
-
Oct 4th, 2020, 03:43 AM
#15
Re: [VB6 Add-In] Project Examiner
Originally Posted by Eduardo-
Just a shot in the dark: do you have SP6 installed?
(I guess you do, but just to be sure)
Of course
I am 100% up to date, and it is a commercial product (quite big, millions of lines)
-
Oct 4th, 2020, 04:26 AM
#16
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
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)
OK.
-
Oct 4th, 2020, 04:32 AM
#17
Re: [VB6 Add-In] Project Examiner
I have found the reason, give me a few minutes to test again.
NB : Extraction of the strings gave me 18000 lines
-
Oct 4th, 2020, 04:45 AM
#18
Re: [VB6 Add-In] Project Examiner
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
-
Oct 4th, 2020, 05:03 AM
#19
Re: [VB6 Add-In] Project Examiner
Ah OK, thank you! I'll make the changes later.
-
Oct 4th, 2020, 05:33 AM
#20
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
NB : Extraction of the strings gave me 18000 lines
That's really a lot. I have two quite large programs but thy are around 4000 lines. But that now including all FontName.
-
Oct 4th, 2020, 05:47 AM
#21
Re: [VB6 Add-In] Project Examiner
Last edited by reexre; Oct 4th, 2020 at 06:01 AM.
-
Oct 4th, 2020, 06:33 AM
#22
Re: [VB6 Add-In] Project Examiner
Updated.
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.
Please test and report.
-
Oct 4th, 2020, 07:43 AM
#23
Re: [VB6 Add-In] Project Examiner
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>
-
Oct 4th, 2020, 09:00 AM
#24
Re: [VB6 Add-In] Project Examiner
Originally Posted by wqweto
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.
-
Oct 4th, 2020, 09:20 AM
#25
Re: [VB6 Add-In] Project Examiner
It should be same problem as I had
-
Oct 4th, 2020, 09:33 AM
#26
Re: [VB6 Add-In] Project Examiner
Originally Posted by Thierry69
It should be same problem as I had
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.
-
Oct 4th, 2020, 11:18 AM
#27
Re: [VB6 Add-In] Project Examiner
It's failing on this line
Set iDes = iComp.Designer
. . . with "Application-defined or object-defined error".
I changed it with this
Code:
Set iDes = Nothing
On Error Resume Next
Set iDes = iComp.Designer
On Error GoTo ErrorExit
If iDes Is Nothing Then
Set iDes = iComp.Designer
End If
. . . and it seems to work now. No idea why the second time getting Designer succeeds.
cheers,
</wqw>
-
Oct 4th, 2020, 11:24 AM
#28
Re: [VB6 Add-In] Project Examiner
Originally Posted by wqweto
It's failing on this line
Set iDes = iComp.Designer
. . . with "Application-defined or object-defined error".
I changed it with this
Code:
Set iDes = Nothing
On Error Resume Next
Set iDes = iComp.Designer
On Error GoTo ErrorExit
If iDes Is Nothing Then
Set iDes = iComp.Designer
End If
. . . and it seems to work now. No idea why the second time getting Designer succeeds.
cheers,
</wqw>
Are you using the updated version? (I guess not).
I'll put more clear in the OP that it has been updated.
-
Oct 4th, 2020, 12:44 PM
#29
Re: [VB6 Add-In] Project Examiner
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
-
Oct 4th, 2020, 08:09 PM
#30
Re: [VB6 Add-In] Project Examiner
Updated.
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).
-
Jan 18th, 2021, 05:36 PM
#31
Re: [VB6 Add-In] Project Examiner
Updated!
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.
-
Jan 19th, 2021, 11:56 AM
#32
Re: [VB6 Add-In] Project Examiner
Updated again.
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.
-
Jan 26th, 2021, 05:45 AM
#33
Re: [VB6 Add-In] Project Examiner
Updated: bug fix at the 'Find controls' tab, now it allows to compare to empty strings ("")
PS: I'm finding this tool very useful now that I'm working on improving a large program.
-
Jan 26th, 2021, 06:15 PM
#34
Re: [VB6 Add-In] Project Examiner
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.
-
Jan 27th, 2021, 04:39 AM
#35
Re: [VB6 Add-In] Project Examiner
Important bug fixes:
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
-
Jan 28th, 2021, 07:58 PM
#36
Re: [VB6 Add-In] Project Examiner
New release with some changes.
-
Feb 22nd, 2021, 07:38 PM
#37
Re: [VB6 Add-In] Project Examiner
Hi Eduardo,
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. To all, peace and happiness.
-
Feb 22nd, 2021, 11:52 PM
#38
Re: [VB6 Add-In] Project Examiner
Originally Posted by Elroy
Hi Eduardo,
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).
-
Feb 23rd, 2021, 12:22 AM
#39
New Member
Re: [VB6 Add-In] Project Examiner
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
-
Nov 28th, 2021, 09:01 PM
#40
Re: [VB6 Add-In] Project Examiner
Update released.
When there is an error opening a form, it tells you now with a message what form could not be loaded instead of just cancelling silently.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|