Results 1 to 6 of 6

Thread: Use CallByName to manipulate late-bound controls properties and methods

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Use CallByName to manipulate late-bound controls properties and methods

    My project needs to load all third-party controls dynamically, that is, all controls are late-bound. Olaf has helped me solve the problems of dynamically loading controls. Thank you so much, Olaf.

    I'm thinking about a question:

    Is it possible to manipulate all the properties and methods of a late-bound control with CallByName?

    Of course, this is just an idea, and I haven't actually tried it yet. I wonder if this is theoretically possible, and as long as it is theoretically possible, I'll start trying. In other words, I wonder whether CallByllByName has some limitations in usage scenarios. Thanks.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Use CallByName to manipulate late-bound controls properties and methods

    In most programs you should know the names of members at design time, so you just make normal late-bound calls.

    Sure, there are unusual cases that really must pass a String not known until runtime, but why would such a call know the number and types of arguments to pass?

    There are a few other scenarios like scripting-style event hander binding but that's fairly rare.


    So what is your goal and motivation? What are you doing that's so special?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: Use CallByName to manipulate late-bound controls properties and methods

    Quote Originally Posted by dilettante View Post
    In most programs you should know the names of members at design time, so you just make normal late-bound calls.

    Sure, there are unusual cases that really must pass a String not known until runtime, but why would such a call know the number and types of arguments to pass?

    There are a few other scenarios like scripting-style event hander binding but that's fairly rare.


    So what is your goal and motivation? What are you doing that's so special?
    I'm working on a FormViewer/FormDesigner, which can read Frm/FRX data directly and dynamically display UI elements in a VB6-Form.
    Last edited by SearchingDataOnly; Jun 2nd, 2023 at 11:13 PM.

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

    Re: Use CallByName to manipulate late-bound controls properties and methods

    Many people want to implement their own IDE, or script tool host.

    Today I just saw someone using a VBA form (Microsoft Forms2.0), designing and adding various controls and default values ​​on it, such as adding 5 lines of text to the LISTBOX control, as well as FRAME controls and tab controls.
    After the design is completed, it is directly converted into PYTHON code, and the UI components such as import tkinter or GTK are used to display the effect.
    Of course, it is also possible to directly convert the designed control layout into XML or directly generate a web page, and then open the web page to run the software on the tablet (run EXE in the background, and return data to update the interface)

    You can also package the .NET control components for VB6 to use, or VBS, PYTHON, and VBA can also be used.
    So a visual form designer is still very attractive.
    How to list all default properties of controls (including .NET controls)?

    Implemented form designer, type library browser, code editor, syntax checker. VBS code can be run with VBSCRIPT.EXE host.
    You can also run almost 80% of the VB6 code directly with the VBA SDK.
    If you add a V8-driven dll, you can run JS, and you can also run it with NODEJS.
    It can also cooperate with edge webview2 to directly display UI + run JS code.

    Support for multiple language scripts can also be implemented later, such as VBS, asp, python, js, lua, VBA
    At the same time, it can also be connected with the compiler. The easiest way is to compile the VB code into a vb6 EXE. You can also use the freebasic compiler to generate a 64-bit EXE.

    If one day the compiler of TWINBASIC can also be invoked by the command line, it will not be difficult to compile a VB6 project or just a BAS file into EXE.

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

    Re: Use CallByName to manipulate late-bound controls properties and methods

    you can put object to vbs(x86+x64),so you can write code like web1.document.body.innertext
    later bind,no need call by name.

    you can try callbyname,vbscript,or call object method in js.
    Which one runs faster.


    you also can run code in vbe(vba.dll)
    you can use vba sdk(maybe it's have x64 version)
    Last edited by xiaoyao; Jun 2nd, 2023 at 11:56 PM.

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

    Re: Use CallByName to manipulate late-bound controls properties and methods

    It would be even better if he could be made open source.
    Within the scope of VB6, I haven't seen a project that has a large number of people participating in open source design.
    For example, like sharpdevelop, its entire framework is separate, with menus, toolboxes, and different language implementations, which can be expanded arbitrarily.
    If it is made open source or partially open source, let everyone participate in the design together.

    Some people can develop different functions, integrate them together, and compile them into multiple DLLs to load and run.
    Some implement PYTHON support, and some implement JS support.
    We hope that there will be a partially open source project, and a large number of VB6 developers will participate together to realize any functions we need.

    https://github.com/MicrosoftEdge/WebView2Samples/issues
    https://github.com/twinbasic/twinbasic/issues/

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