• Re-Writing VB Code at RunTime (VB 6)

    Author
    Topic
    #395048

    One of the guys in work says he has heard that you can get VB to re-code itself during runtime. Is this true and how the heck do you do it?

    Thanks
    Jambo

    Viewing 1 reply thread
    Author
    Replies
    • #729204

      Does he explain what he means by “recode itself”?

      • #729220

        I think he measn that the you can write code to change other parts of the code during run time. Kinda like adding a textbox to a form durig run time but changeing the code itself.

        I think!

        Jambo

        • #729229

          I’m going to stick out my neck by saying that although it might be possible in theory, it is not feasible in reality. The VB compiler turns source code into machine code (or into p-code, a kind of intermediary code); there is so much going on at that level that it is not realistic to try and modify it.

          • #729646

            Hi Hans,

            Not only would one have the problem of trying to target the particular piece of machine code (the location of which can vary every time the source code is recompiled), but I think would would probably then run foul of the OS’s meory protection, since the code should rside in a prtected portion of the memory.

            Self-modifying code used to readily achieved under DOS, which had no memory protection, and I wrote one or two assembly langiage utilities that did that. I wouldn’t even have tried with VB’s predecessor – QB.

            Cheers

            Cheers,
            Paul Edstein
            [Fmr MS MVP - Word]

        • #729230

          I’m going to stick out my neck by saying that although it might be possible in theory, it is not feasible in reality. The VB compiler turns source code into machine code (or into p-code, a kind of intermediary code); there is so much going on at that level that it is not realistic to try and modify it.

      • #729221

        I think he measn that the you can write code to change other parts of the code during run time. Kinda like adding a textbox to a form durig run time but changeing the code itself.

        I think!

        Jambo

    • #729205

      Does he explain what he means by “recode itself”?

    Viewing 1 reply thread
    Reply To: Re-Writing VB Code at RunTime (VB 6)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: