Results 1 to 27 of 27

Thread: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 28/08/21)

  1. #1

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Post [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 28/08/21)

    Please download a newer version here: https://www.vbforums.com/showthread....test-versions)


    This post is old and will not be updated
    ***************************************************************************************************



    This is an add-in to display comments and code of user generated
    Functons/Methods/Properties and also some info from typelibs in the project

    Name:  Snap_CCHH_1.jpg
Views: 2187
Size:  54.8 KB

    Name:  Snap_CCHH_Config.jpg
Views: 2163
Size:  30.8 KB


    It takes the text inside comments over the declarations and also from the menu
    Tools->Procedure Attributes or inside typelibs

    (optional) Also have extra hotkeys:
    CTRL+Q: Smart lines comment / uncomment
    CTRL+D: Duplicate Lines
    CTRL+SHIFT+UP and CTRL+SHIFT+DOWN: Move Up or Down selected lines

    (optional) Also has selection highlight on editor on all ocurrences of text/selection. Note: Only support MONOSPACE FONTS


    IMPORTANT: This is a WIA (Work In Progress) I'm releasing this AddIn as
    an unfinished project. Its working but I feel there is still some more
    polishing to do. Just dont have the time needed right now.


    NOTE: If highlighting a word doesnt seem to work try selecting another word and then
    reselecting the word you want to hihglight OR scroll the editor up/down to force
    re apply highlighting.


    Special thanks to Fafalone and LaVolpe for helping how to access typelibs data.


    DOWNLOAD: prj (AddIn) ComCodeDisplay v1.1.zip

    Changelog:

    v0.8 (06/05/21)
    +Initial release.
    v0.8b (07/05/21)
    +Highlight: Fixed default font values and without comment viewer
    v0.8c (10/05/21)
    +Highlight: Fixed horizontal scrolling on editor
    v0.8d (11/05/21)
    +Highlight: Fixed lines with ampersand ('&')
    +Removed reference to Office objects
    v0.8e (12/05/21)
    +Fixed default VB6 to Courier New and not Times New Roman
    (for people who have never changed the font)
    v1.0 (10/06/21)
    +Fixed ExtraHotkeys to work on all opened VB6 instances and not just one
    v1.1 (26/08/21)
    +Fixed Loading, now support big groups with multiple projects
    +Comments with lines with separators like '======' (same char) are cut to display better

  2. #2
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Big Pit, very good as always, MADE IN ARGENTINA!!
    leandroascierto.com Visual Basic 6 projects

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

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Very nice.
    Compiled, and already using it.
    This is one of the feature I like in Visual Studio 2019.

    NB : A minor bug for the moment
    When I select the variable in the line
    oHTTP_Record.Close

    or
    oHTTP_Record.MoveNext

    It hightlights the whole line, instead of oHTTP_Record only

  4. #4

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Quote Originally Posted by Thierry69 View Post
    Very nice.
    Compiled, and already using it.
    This is one of the feature I like in Visual Studio 2019.

    NB : A minor bug for the moment
    When I select the variable in the line
    oHTTP_Record.Close

    or
    oHTTP_Record.MoveNext

    It hightlights the whole line, instead of oHTTP_Record only
    When you write or just place the cursor its a feature not a bug. It try to detect the object the method belong to.
    if you are using A.Draw, B.Draw, C.Draw it will make a distinction between A.Draw and B.Draw because its not the same call.
    But if you select Draw with the mouse then it should paint all "DRAW" text no matter what.
    I know there are some glitchs still to be fixed :/

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

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    You could configure it as customisable settings.

    Also, maybe avoid to highlight some characters like ) ( = - etc...
    at least if less than 2 chars are selected

  6. #6
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    I am having trouble compiling the add-in.
    "The binary compatibility DLL or EXE contains a parameter type or return type whose definition can not be found"
    I don't have office installed.
    it is required for this plugin.
    MISSING: Microsoft Office 12.0 Object Library

    greetings, good job as always

  7. #7

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Quote Originally Posted by yokesee View Post
    I am having trouble compiling the add-in.
    "The binary compatibility DLL or EXE contains a parameter type or return type whose definition can not be found"
    I don't have office installed.
    it is required for this plugin.
    MISSING: Microsoft Office 12.0 Object Library

    greetings, good job as always
    You need the reference for this:
    Dim mcbMenuCommandBar As Office.CommandBarControl
    Dim ToolbarIcon1 As Office.CommandBarControl

    Not sure how you can do it without it

  8. #8
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Many people do not have MS-Office installed on their computers.

  9. #9
    New Member
    Join Date
    Nov 2013
    Posts
    15

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Great addin shagratt, this one together with the DocumentMap makes coding and debugging easier.

  10. #10

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Quote Originally Posted by yokesee View Post
    I am having trouble compiling the add-in.
    "The binary compatibility DLL or EXE contains a parameter type or return type whose definition can not be found"
    I don't have office installed.
    it is required for this plugin.
    MISSING: Microsoft Office 12.0 Object Library

    greetings, good job as always
    Quote Originally Posted by SearchingDataOnly View Post
    Many people do not have MS-Office installed on their computers.

    Try now please! I removed the dependency and seems to be working

  11. #11
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Quote Originally Posted by shagratt View Post
    Try now please! I removed the dependency and seems to be working
    Thank you, shagratt.

    What's this:
    Code:
    TextHY& = (Me.TextHeight("j?) / 15) '* FDPI

  12. #12

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8c

    Quote Originally Posted by SearchingDataOnly View Post
    What's this:
    Code:
    TextHY& = (Me.TextHeight("j?) / 15) '* FDPI
    The text is "jÄ". One of the lowest letters with one of the highest. I use it to get the height of standard line with the selected font.
    I should also noted in the description that it only support monospace fonts. I'm not sure what font is standard for the asian versions of vb6. I can only test English and Spanish ones.

  13. #13
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,871

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    I think you should replace "/ 15" with "/ Screen.TwipsPerPixelY"

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

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    There is a problem with the code, the compilation fails
    frmAddIn.frm
    TextHY& = (Me.TextHeight("j?) / 15) '* FDPI

  15. #15
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    Thank you very much for bothering to remove the reference.
    I have the following visual errors.
    modify the offset but it doesn't work.


    a greeting

  16. #16

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    Quote Originally Posted by xiaoyao View Post
    There is a problem with the code, the compilation fails
    frmAddIn.frm
    TextHY& = (Me.TextHeight("j?) / 15) '* FDPI
    Replace "j? with "jÁ" I will change in the code the original Ä with Á seems to be causing a problem with asian fonts.

  17. #17

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    Quote Originally Posted by Arnoutdv View Post
    I think you should replace "/ 15" with "/ Screen.TwipsPerPixelY"
    Done! Thanks for the suggestion. Also replaced with Screen.TwipsPerPixelX where needed.
    But support for high DPI is currently not supported and may not work at all.

  18. #18

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    Quote Originally Posted by yokesee View Post
    Thank you very much for bothering to remove the reference.
    I have the following visual errors.
    modify the offset but it doesn't work.


    a greeting
    Hi Yokesee! It looks like the font used to Highlight is not the same youre using in the IDE (problem detecting the right font?). Try going to the VB6 options and change the IDE font to "Consolas" then close and restart VB6. If it work then change again to the font you want and restart again to see if its working.

  19. #19
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    Wauuu you are the best, it works perfectly.
    A small bug or not.
    When you have highlighted a word and you change to a block of comments, it continues marking highlighted above


    very good work

  20. #20

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys v0.8d

    Quote Originally Posted by yokesee View Post
    Wauuu you are the best, it works perfectly.
    A small bug or not.
    When you have highlighted a word and you change to a block of comments, it continues marking highlighted above
    very good work
    I'm not sure to understand you. I tried to select text o just put the cursor over a word. Then I pressed the comment button and it change the highlighting to the same word and visually it update the position 1 char to the right. Dont see any bug there

  21. #21

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 10/06/21

    v1.0 (10/06/21)
    +Fixed ExtraHotkeys to work on all opened VB6 instances and not just one

  22. #22
    Addicted Member
    Join Date
    Jul 2016
    Posts
    230

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 10/06/21

    Hey

    I'm using WinXP SP3 and in v1.0 I had to edit ComCodeDisplay.vbp and change
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0; MSCOMCTL.OCX
    to
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
    otherwise the project failed to open.

    How do I get the "PopOut" windows to appear?

  23. #23

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 10/06/21

    Quote Originally Posted by OldClock View Post
    Hey
    I'm using WinXP SP3 and in v1.0 I had to edit ComCodeDisplay.vbp and change
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0; MSCOMCTL.OCX
    to
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
    otherwise the project failed to open.
    Seems I got a newer version... And when I encountered that problem on other projects I fixed them in the same way you did.
    I wonder why are you still using XP ?


    Quote Originally Posted by OldClock View Post
    How do I get the "PopOut" windows to appear?
    When you select something in the code, if it detect a description for it, it will open the window with the description on the top-right (default position) and there, near the cog (config) icon you have the popout button. Its shown in the first picture in the first post.

    Right now I think there is a bug in the detection system. I only tested on single proyects with no more than 20 files. When tried to use it on a big multi proyect work seems to fail to detect anything. :-/

  24. #24

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 28/08/21

    Update:
    v1.1 (26/08/21)
    +Fixed Loading, now support big groups with multiple projects
    +Comments with lines with separators like '======' (same char) are cut to display better

  25. #25
    Addicted Member
    Join Date
    Jul 2016
    Posts
    230

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 28/08/21

    > I wonder why are you still using XP ?

    Two-fold: first, I code in a virtual machine from Linux, and WinXP is much faster in a VM than Win10. Second, until recently a lot of the African users of my software still used WinXP, though now it looks like most have moved on:

    Name:  StatCounter-windows_version-ww-monthly-200901-202107.jpg
Views: 1028
Size:  20.6 KB
    https://gs.statcounter.com/windows-v...-200901-202107

    v1.1 runs much faster on a large project than v1.0.
    Last edited by OldClock; Aug 27th, 2021 at 06:41 AM.

  26. #26
    Addicted Member
    Join Date
    Jun 2010
    Posts
    182

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 28/08/21

    I'm currently testing this Add-in (together with Document Map) and I'm not quite sure about the scope of the Add-in as sometimes I see something happens and sometimes not, when click on or highlight a code member. So what exactly does "user generated Functons/Methods/Properties" imply? I would imaging e.g. functions and subs I create in my modules/forms code windows, but obviously not as they don't yield any response. Class members though brings some live to it but I'm still to see any code show up in that little window in the top right corner. Also, the image in 1st post is of very low quality and hard to read.

    I was wondering, I have Code Smart 2013 installed and activated and wonder if there could be some conflict as at some point I saw the add-in window show to just immediately go away.
    M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?

  27. #27

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn - Comment/Code Display + Highlight + Extra Hotkeys (Updated 28/08/21

    Quote Originally Posted by 7edm View Post
    I'm currently testing this Add-in (together with Document Map) and I'm not quite sure about the scope of the Add-in as sometimes I see something happens and sometimes not, when click on or highlight a code member. So what exactly does "user generated Functons/Methods/Properties" imply? I would imaging e.g. functions and subs I create in my modules/forms code windows, but obviously not as they don't yield any response. Class members though brings some live to it but I'm still to see any code show up in that little window in the top right corner.
    Hi 7edm!
    It should detect the functions/subs you create on most cases. Just remember they need to have explicit scope ("Public Sub XXXX" / "Private Sub XXXX" instead of "Sub XXXX"). The parser I made is not perfect but should detect lots of cases without errors.


    Quote Originally Posted by 7edm View Post
    Also, the image in 1st post is of very low quality and hard to read.
    Yes I know...Sadly quality of jpgs uploaded to this forums become too compressed to save space.


    Quote Originally Posted by 7edm View Post
    I was wondering, I have Code Smart 2013 installed and activated and wonder if there could be some conflict as at some point I saw the add-in window show to just immediately go away.
    I use CodeSmart too and have no problem with that. It was designed with compatibility with it in mind.
    The first time It may show and hide inmediately but after that it should start working fine. (It was a bug... cant remember if I got it fixed in the latest version (not the one on this post) I only remember spending lot of time tracking why happened)


    Please download a newer version here: https://www.vbforums.com/showthread....test-versions)

Tags for this Thread

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