Results 1 to 3 of 3

Thread: Late Binding vs. Early Binding

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    45

    Smile

    I am creating a simple project.
    The project has a form module and a class module.
    The class module has only two pair property procedures: LastName and FirstName.
    The class is named MyClass

    In the Form Module I create two instances of the class module:

    Early Binding:
    Public InstanceOne as New MyClass

    Late Binding:
    Public InstanceTwo as Object
    Set InstanceTwo = New MyClass

    Now when I go to reference the properties in my form I get a drop down menu of available properties for InstanceOne but NOT for InstanceTwo. (The available properties being FirstName and LastName). Both work fine, but only the one declared with early binding gives me that handy menu. Is something wrong here or is this just life?
    -Gregg
    -NoOBie At LaRg3

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    hi!

    I recall (I could be wrong)

    1. With early binding VB provides a great deal of help
    It pops up quick-fill help to guide us to the correct
    spelling of method and property names. It will also
    show the syntax of these elements just as if they
    were built-in VB methods and properties
    "From VB6 OBjects"

    2. The methods and properties of late-bound entities are
    made aware (at run time) just before they actually get
    called

    Vale!

  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    If you can, always go for early binding.

    Early Binding vs Late Binding
    • 1. With early binding You get the type ahead help from VB, you do not get this with late binding. It is a lot easer to program if you can see what properties / methods you can access / use.
    • 2. The code runs quicker with early binding. This is because when you compile VB can check that all of the properties exist, and are called with the right number of arguments etc. If you use late binding, VB has to check that the property / method you are using actually exists as it is called, and that you are calling it correctly.

    Iain, thats with an i by the way!

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