Results 1 to 40 of 40

Thread: [VB6 Add-In] Project Examiner

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    [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:

    Name:  PE1.png
Views: 93296
Size:  10.5 KB

    Name:  PE4.png
Views: 2653
Size:  10.5 KB

    Name:  PE6.png
Views: 2652
Size:  14.5 KB

    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.

  2. #2
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    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.

  3. #3
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    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

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    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

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    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.

  6. #6
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: [VB6 Add-In] Project Examiner

    Same problem.
    Always on the same form, the 26's form

  7. #7
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Eduardo- View Post
    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)

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    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?

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    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).

  10. #10
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    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>

  11. #11
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: [VB6 Add-In] Project Examiner

    No problem of ram (32gb)
    I'll try to figure out

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by wqweto View Post
    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.

    Quote Originally Posted by wqweto View Post
    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?

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    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)

  14. #14
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    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"

  15. #15
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Eduardo- View Post
    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)

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    Extracting string (I found 2 labels that where not translated),
    I don't understand what you mean.

    Quote Originally Posted by Thierry69 View Post
    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).

    Quote Originally Posted by Thierry69 View Post
    Of course
    I am 100% up to date, and it is a commercial product (quite big, millions of lines)
    OK.

  17. #17
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    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

  18. #18
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    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

  19. #19

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Ah OK, thank you! I'll make the changes later.

  20. #20

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    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.

  21. #21

  22. #22

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    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.

  23. #23
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    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>

  24. #24

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by wqweto View Post
    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.

  25. #25
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: [VB6 Add-In] Project Examiner

    It should be same problem as I had

  26. #26

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Thierry69 View Post
    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).

  27. #27
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    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>

  28. #28

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by wqweto View Post
    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.

  29. #29
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    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

  30. #30

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    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).

  31. #31

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    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.

  32. #32

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    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.

  33. #33

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    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.

  34. #34
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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.

  35. #35

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    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

  36. #36

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    New release with some changes.

  37. #37
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    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.

  38. #38

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [VB6 Add-In] Project Examiner

    Quote Originally Posted by Elroy View Post
    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).

  39. #39
    New Member
    Join Date
    Nov 2020
    Posts
    7

    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

  40. #40

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    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
  •  



Click Here to Expand Forum to Full Width