Results 1 to 29 of 29

Thread: (VB6) Component Documenter

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    (VB6) Component Documenter

    This is a tool to help document ActiveX components.

    Name:  CompDoc_scr1.jpg
Views: 307
Size:  26.7 KB

    You can import the information from the OCX or DLL file, and if you added the description of each member in the IDE, that will be added automatically as a "short description".

    With that you could already generate something useful, but the purpose is to document it better by adding a "long description", specially for the properties and methods that might not be intuitive.

    Anyway, when generating the final files from the 'Report' menu, it will pick the long description if available or otherwise the short one also if available.

    If no descriptions are available at all, the report generated could still have some value, but only to see the structure of Controls/Classes/Properties/Methods/Events and the parameters of each member, but will have no explanation.

    The long description allows some markup to reference other members (members are properties, methods and events) or the reference other Controls or Classes, also to reference Enums (not individual constants).

    The markup works like this:
    [c[ControlName]] refers to a control
    [o[ClassName]] refers to a class, also called 'object'
    [p[PropertyName]] refers to a property
    [m[MethodName]] refers to a method (function or sub)
    [e[EventName]] refers to an event
    [[EnumName]] refers to an enum

    There are some buttons that help to do that automatically.

    <b>some text</b> is for bold text.

    You can also put html links if you want, by placing the html code for them.

    It can output HTML, RTF, PDF (through a PDF printer driver) and plain text.

    The HTML pages can be one, one per object (control/class) and one per member (property/method/events). This is set in the menu Reports/Options.
    You can also set some custom header/footer/style for the HTML files.

    Download from GitHub.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    Re: (VB6) Component Documenter

    Reserved

  3. #3
    Addicted Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    247

    Re: (VB6) Component Documenter

    interesting good job

  4. #4
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    Quote Originally Posted by Eduardo- View Post
    This is a tool to help document ActiveX components.
    The markup works like this:
    [c[ControlName]] refers to a control
    [o[ClassName]] refers to a class, also called 'object'
    [p[PropertyName]] refers to a property
    [m[MethodName]] refers to a method (function or sub)
    [e[EventName]] refers to an event
    [[EnumName]] refers to an enum

    There are some buttons that help to do that automatically.

    <b>some text</b> is for bold text.

    You can also put html links if you want, by placing the html code for them.

    It can output HTML, RTF, PDF (through a PDF printer driver) and plain text.

    The HTML pages can be one, one per object (control/class) and one per member (property/method/events). This is set in the menu Reports/Options.
    You can also set some custom header/footer/style for the HTML files.

    Download from GitHub.
    If you can output JSON format, it would be perfect. Parse the VB6 project, module files bas, cls class files into JSON format, and parse a single function header Fumction sum (byval a as long ,b as long) as long into JSON, and parse each line of code into JSON.
    To do this, you can convert VB6 into PYTHON, JAVA code, VC++ code.

  5. #5
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    I once got part of the code from a tool that used VB6 source code to reverse compile a program (exe, dll, ocx) developed by VB6.
    With just a short VB6 code, you can get all the attributes of a DLL, OCX, ENUM, methods, events, each parameter name, and data type.

    It is equivalent to a VB6 object viewer.
    You have a lot of code and more complete functions. Thank you for your work.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    Re: (VB6) Component Documenter

    I don't think that JSON makes sense here since the output formats needed are to be read by humans, not to store or to transmit information.
    I have considered to output to markdown for making GitHub's *.md help files, but decided that it didn't worth the effort, at least for now.
    But if at a point i need it or someone else ask for it, it could be added.

    But JSON... i don't see the point. May be if you explain why or what would be the purpose.

  7. #7
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    In fact, I want to get all the interface, function and other information of a COM DLL or OCX. If this is a class library, provide a function, the input parameter is the DLL file name, and what is returned is all the information of the COM DLL object in JSON format.
    Then it is used to make my script tool to handle events, functions, and method calls.

    designer windows controls,Code intelligent prompting, COM DLL attribute analysis, so that my simple script tool IDE can be completed. Support any third-party OCX control.

    I just recommend. You can also treat it as if you didn't see it. This is just my personal project.

    .NET visual form designer, only 50 lines of code!!!-VBForums
    https://www.vbforums.com/showthread....%26%2365281%3B

  8. #8
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    461

    Re: (VB6) Component Documenter

    Esuardo, I wrote something similar (20 years ago), and event to document full applications, in VBIDEUtils (on github).
    Maybe it could inspire you

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    Re: (VB6) Component Documenter

    Quote Originally Posted by Thierry69 View Post
    Esuardo, I wrote something similar (20 years ago), and event to document full applications, in VBIDEUtils (on github).
    Maybe it could inspire you
    I think I saw it some time ago, I thought it was some modified version of vbAccelerator's ActiveX Documenter (was I wrong?).

    vbAccelerator's program didn't allow to add any further explanation, and the output wasn't what I wanted/needed, so I decided to write this new one.
    Last edited by Eduardo-; May 7th, 2021 at 04:31 AM.

  10. #10
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    I have another idea.There are many controls, too many property events.We can increase the statistics that have been learned and learned.In this way, if you have learned the use of half of the methods, you will show 50%.
    Which other control properties are used by the most people? Which methods are more commonly used?

  11. #11
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    Listing all the attributes and methods is a normal practice, so it can be made into an independent module.
    About how to collate the later data. For example, each method can write its own test project. Or a line of test code.

    For example, I especially like to write these English names in Chinese, that is, every attribute method should be translated.
    And add the problems encountered in the learning process to be recorded.

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    Re: (VB6) Component Documenter

    Quote Originally Posted by xiaoyao View Post
    Listing all the attributes and methods is a normal practice, so it can be made into an independent module.
    About how to collate the later data. For example, each method can write its own test project. Or a line of test code.
    That would be some other tool. This one is only to document.
    But you could write it. The only thing in common would be the use of TLBINF32.DLL.

    Quote Originally Posted by xiaoyao View Post
    For example, I especially like to write these English names in Chinese, that is, every attribute method should be translated.
    And add the problems encountered in the learning process to be recorded.
    I don't think that translating the members and parameters names would be a good idea, since the reader need to learn the names that they will have in the development environment, she/he needs to get familiar with them even when they are in another language.

    But I've thought about handling different languages in the program to output the information to different languages, or even automating Google translator to help you to translate from one language to another.
    That would be on version 2 or 3, if at any point they come.
    Anyway, I think developers need to get used to read technical information in English.

    It is time consuming to make documentation in one language, not to say making (and maintaining) it in many.
    And other point is that Google translation need to be manually revised, it is not right every time, and... if you don't know the language and cannot hire a human translator to perform the revision... the output won't be as good.

  13. #13
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    When my friend developed the IDE, he translated a lot of English materials into Chinese, but did not keep the original English text.
    If at the beginning, every word is classified accurately, and there are Chinese and English at the same time, it will be no problem to convert to 10 languages.
    If the translation is wrong, you only need to modify one line, or ask the user to use the software to translate it.
    If my friend create two fields, English and Chinese, then add German and Japanese in the future.


    For me, translation is mainly used to quickly learn the use of controls.
    Controls have a large number of properties, methods, and many names are not necessarily English words, and some are difficult to remember.
    CC.RenderSurfaceContent Cairo.ImageList.AddImage("BG", BgFile, Srf.Width, Srf.Height), 0, 0
    It's use for draw background picture on usercontrol
    Srf.WriteContentToPngFile PngFile
    Used to save SVG images to PNG files
    Last edited by xiaoyao; May 7th, 2021 at 06:20 AM.

  14. #14
    Fanatic Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    930

    Re: (VB6) Component Documenter

    Quote Originally Posted by Eduardo- View Post
    But JSON... i don't see the point. May be if you explain why or what would be the purpose.
    JSON, XML are useful standards to use, they can be picked up by other tools, potentially useful in migration. If you had a tool that could describe all of a forms' controls properties in XML using standard descriptions for x, y position &c then with just a little tweaking a design could be pulled into any forms designer that can read XML.

    As far as being human-readable is concerned I have found no problems so far with XML.

    JSON seems to be the new way of doing things that is perhaps more suited to the web but following a standard is a good thing to do...in itself.

    I think xiaoyiao's need is to allow him to use these and similar functions in his potential new IDE that is likely to use XML or JSON as the object descriptor storage.

  15. #15
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    In fact, many good tools, if they are packaged into a function to output, the data will be very convenient for programming twice.
    For example, some people convert VB6 projects into 64-bit TWINBASIC and the like. He must have written a parsing project code, mainly because he is not willing to share this interface.
    Otherwise, the form of VB6 will be parsed clearly. It is not difficult for us to recreate a form with JS or .NET for the JSON configuration.
    Just like PHOTOSHOP provides some script editing functions, allowing code loop operations and batch processing pictures according to specified actions.

    A tool can only be used, but if various functions are made into module interfaces, controls, and standard DLLs, it can become a USB data cable, which can be used directly by tens of thousands of developers instead of Repeat programming.

    like this:
    Simply put, it is to pack some more complex functions into the simplest interface for others to use, or for their own use, to improve the code reuse rate.
    Maybe this is also modular development. Try yourselves as much as possible, write the same code for others only once, and you can use it directly after writing it, and you don’t need to learn.
    Code:
    Public Function Script(code As String) As String
        Dim obj As Object
        Set obj = CreateObject("MSScriptControl.ScriptControl")
        obj.AllowUI = True
        obj.Language = "JavaScript"
        Script = obj.Eval(code)     
    End Function

  16. #16
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    Quote Originally Posted by yereverluvinuncleber View Post
    JSON, XML are useful standards to use, they can be picked up by other tools, potentially useful in migration. If you had a tool that could describe all of a forms' controls properties in XML using standard descriptions for x, y position &c then with just a little tweaking a design could be pulled into any forms designer that can read XML.

    As far as being human-readable is concerned I have found no problems so far with XML.

    JSON seems to be the new way of doing things that is perhaps more suited to the web but following a standard is a good thing to do...in itself.

    I think xiaoyiao's need is to allow him to use these and similar functions in his potential new IDE that is likely to use XML or JSON as the object descriptor storage.
    Yes, the form designer provided in .NET can directly display all properties, but how to save it? How to read is another problem.
    But JSON is definitely a universal format that supports various UNICODE languages (it will be automatically encoded and automatically restored when parsed). The amount of data is small, so it is the most suitable.
    The XML format takes up too much space and may be easy to read for programming, but it takes a lot of effort to manually view or modify it. The form file form1.frm, similar to VB6, is actually very similar to the JSON format.

    For example, windows api:
    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    How to convert this into JSON format? In this way, only a simple syntax converter can be used to directly generate call codes for DELPHI, VB.NET, C#, JAVA and other languages.

  17. #17
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    An IDE I am developing, the focus will be to support various new element UI styles, support various third-party controls, web page display, .NET controls can also be added to VB forms, including rc6.dll cario, svg vector Figure.
    The webbrowser control can also display svg, animation, and many report controls and 3D controls with amazing effects.
    So you need to read out the control properties, how many events, and methods there are all in a programming format. JSON is a good format.
    For example, if you want to set the background color, web pages and various reports use different attribute names. With JSON+datasheets, you can use a unified name, which will automatically be set to the original attributes.

  18. #18
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    Quote Originally Posted by Eduardo- View Post
    It is time consuming to make documentation in one language, not to say making (and maintaining) it in many.
    And other point is that Google translation need to be manually revised, it is not right every time, and... if you don't know the language and cannot hire a human translator to perform the revision... the output won't be as good.
    My friend has developed a small tool for batch translation. Open the online translation webpage, manually select the two languages ​​to be translated, and then the next step is: paste the text in the left border and copy the text in the right border
    Empty again, and then continue to cycle.
    (This only requires a webbrowser control, and then learn to use web pages to fill in forms and read)

    In fact, this tool can also be turned into a control, or a DLL, wouldn’t it be more convenient to make all the functions into a DLL? In fact, there is not much work added during the design. After being proficient, developing a control and developing an ordinary EXE will not take up more time.

    Code:
    Set vDoc = WebBrowser1.Document
                For i = 0 To vDoc.All.length-1
                    If UCase(vDoc.All(i).tagName) = "INPUT" Then
                        Set vTag = vDoc.All(i)
                        If vTag.Type = "text" Or vTag.Type = "password" Then
                            Select Case vTag.Name
                            Case "userid"
                                vTag.Value = "wangquan"
                            Case "userps"
                                vTag.Value = "1282"
                            End Select
                        ElseIf vTag.Type = "submit" Then
                            vTag.Click
                        End If
                    End If
                Next i
    you memu:report to htm,(also can export to JSON TEXT file)
    or change you project some code to CLASS FOR Activex dll.
    like DllToJson(dll,jsonfile),then list all events,method by that dll
    Last edited by xiaoyao; May 7th, 2021 at 06:44 AM.

  19. #19

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    Re: (VB6) Component Documenter

    Quote Originally Posted by yereverluvinuncleber View Post
    JSON, XML are useful standards to use, they can be picked up by other tools, potentially useful in migration.
    Yes, I have thought about that after considering xiaoyiao's proposal of exporting to JSON.
    That could be useful to import the data into a third party reporting tool.
    But the point is that the alleged reporting tool would expect the data no only in JSON (or XML), but in some specific way, unless it is very versatile and configurable.
    So, if I don't know what the tool expect, I cannot output it in the right expected format. And BTW, they must exist, but I'm not aware of such tools.

    Anyway, until a practical real case is presented, someone that don't like how this program outputs the information, and wants to just to use it to generate the data for later export to another reporting tool, we are talking about assumptions, and I won't spend days working on assumptions.

    Quote Originally Posted by yereverluvinuncleber View Post
    If you had a tool that could describe all of a forms' controls properties in XML using standard descriptions for x, y position &c then with just a little tweaking a design could be pulled into any forms designer that can read XML.
    It does not describe forms, it is for components interfaces.
    I think you are misunderstanding this program.

    Quote Originally Posted by yereverluvinuncleber View Post
    As far as being human-readable is concerned I have found no problems so far with XML.
    Yes, you can also read pure html files's code if you want. But for "human readable" I was talking about like the format of a manual, or what msdn has on the web (not if you could figure the content).

  20. #20
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    I am a very creative person
    In fact, as long as you manage the usage of most of the mainstream controls in the world, you can start a great company.
    All the control manufacturers address, whether they are in update, telephone number, price, if you get a preferential price, you can also be an agent.
    The usage of all controls can be made into multiple languages, and then write an example for each attribute to test. Although Microsoft has weakened the concept of OCX and COM DLL, the core of EDGE is also exposed to programming developers using COM objects.
    The control class in .NET is actually COM.

    Different programming languages ​​cannot do without the cooperation of standard DLL, COM DLL and OCX. In fact, there are many tools that can be installed automatically, run on the command line and return text.
    They can be packaged into a unified standard to use.
    Including the Chinese driver wizard software, 100M, bought on a new computer, as long as the software is installed with a USB disk, the network card can be automatically recognized, and then automatically go to the website to download various drivers, and then automatically install it.
    Many software installations are done in different ways, but they implement most of the automatic click-and-wait installation.

  21. #21
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    LIKE API IN SOME IDE
    If it is in JSON format, it can be converted to any other format
    http://www.vbgood.com/api-findwindow.html

    and how to use json object? rc6.dll ,or some vb6 *.bas file can make json so easy
    add data to json object like treeview,like dir path.and get all data will be string.
    it can be add,delete,update,it's like a simple database.
    Attached Images Attached Images   
    Last edited by xiaoyao; May 7th, 2021 at 07:01 AM.

  22. #22

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    Re: (VB6) Component Documenter

    What do you want to do with the JSON xiaoyao, concrete?
    I could add the JSON export option with some hours work I think, but I still don't see for what.

    It could even work in batch mode, where you call the program with two parameters: the path to the input OCX or DLL, and the path to the desired output JSON file.
    Of course it won't have any information added, that was the main purpose of this program.

    But I don't see the point, other than making generic web pages about components interfaces.

  23. #23
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    XiaoYao Json Class by ScriptControl 【very interesting】-VBForums
    https://www.vbforums.com/showthread....%26%2312305%3B

    I wrote code for a few hours, you try to see if this is useful

  24. #24

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,232

    Re: (VB6) Component Documenter

    Ok, attached is a version that can export to JSON, see if you can do anything with it.
    It uses dilettante's JsonBag.
    Attached Files Attached Files
    Last edited by Eduardo-; May 7th, 2021 at 09:29 AM.

  25. #25
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    yes ,it's good,thank you
    some argument type can use like string ,long,I will study this in the future and I will communicate with it later

  26. #26
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    Quote Originally Posted by Eduardo- View Post
    What do you want to do with the JSON xiaoyao, concrete?
    I could add the JSON export option with some hours work I think, but I still don't see for what.

    It could even work in batch mode, where you call the program with two parameters: the path to the input OCX or DLL, and the path to the desired output JSON file.
    Of course it won't have any information added, that was the main purpose of this program.

    But I don't see the point, other than making generic web pages about components interfaces.
    like i add ocx from vbs, i need khnow ocx have how much method.

    I have a special idea, which is to create a form in VBS and add controls, so I need to know every method, property, and event of the control.
    Of course, there are many uses, as long as everything is made into a common format, it will always be very convenient.
    For example, what should we do when the new crown epidemic comes?
    1. Wear a mask
    2. Less contact
    3. Less gatherings
    If the United States required strict requirements at the first time, it is estimated that the plague would have ended a year ago.
    The world needs strict standards. The data and methods are all like this

  27. #27
    Fanatic Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    930

    Re: (VB6) Component Documenter

    Quote Originally Posted by Eduardo- View Post
    It does not describe forms, it is for components interfaces.
    I think you are misunderstanding this program.
    Of course I understand, it was a generalisation. Just explaining why xiaoyiao might find such an export useful in general terms.

  28. #28
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    Quote Originally Posted by yereverluvinuncleber View Post
    Of course I understand, it was a generalisation. Just explaining why xiaoyiao might find such an export useful in general terms.
    Such as the development of various controls, compilers, code conversion, tlb generation, GDIPLUS, etc. I will be useful. It is not easy to develop a simple IDE. After all, personal ability is limited, but it is not impossible. It is just that with more code support, it can be developed better. Just like a .NET form designer I posted earlier. In the end, only 20-30 lines of actual code were used (about 60 lines of total code). If the best method is not used, it may take 5000-20000 lines of code.

  29. #29
    Taking a Break
    Join Date
    Jan 2020
    Posts
    1,340

    Re: (VB6) Component Documenter

    [VB6] StringBuilder - Fast string concatenation-VBForums
    https://www.vbforums.com/showthread....-concatenation

    like this,it's use Append (s="abc", append "ddd",s ="abcddd")
    i like chage sub name to "add"
    it's not addline,so i need change use:
    sub addline(s)
    append "ddd"
    append vbcrlf
    end sub

    It also takes a lot of time to learn the process usage inside

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