Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Early and Late Binding

Early and Late Binding

Scheduled Pinned Locked Moved Visual Basic
wpfwcftutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Scorpio
    wrote on last edited by
    #1

    Can any body please tell me difference in early and late binding (in VB6) along with example or link.

    S M 2 Replies Last reply
    0
    • S Scorpio

      Can any body please tell me difference in early and late binding (in VB6) along with example or link.

      S Offline
      S Offline
      Steve Pullan
      wrote on last edited by
      #2

      Basically: with early binding the compiler knows the type of object at compile time. With late binding, the type of object is only known at runtime. There are cases for using one or the other but my preference would be for early binding where possible because many problems and type-related issues can be sorted out during development. If you late bind, some problems may not be evident until your application is live! There are many samples of this on the web - including The Code Project. Simply search for them. In the meantime, very brief samples are shown below...

      ' Early Binding
      ' Compiler knows what type x is.

      Dim x As Word.Application
      Set x = New Word.Application

      ' Late Binding:
      ' Only know what type x is at runtime.

      Dim x As Object
      Set x = CreateObject("Word.Application")

      ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

      1 Reply Last reply
      0
      • S Scorpio

        Can any body please tell me difference in early and late binding (in VB6) along with example or link.

        M Offline
        M Offline
        MohammadAmiry
        wrote on last edited by
        #3

        In addition to what Steve said, I should add that early-binding is much much faster than late-binding and is the only case to select (unless you HAVE TO use late-binding) for example when you don't have compile-time access to the COM...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups