What is meant by "Early Binding" and "Late Binding"? Which
is better?

Answer Posted / guest

Early binding and late binding refer to the method used to
bind an interface's properties and methods to an object
reference (variable). Early binding uses type library
information at design time to reference procedures, while
late binding handles this at run time. Late binding
handles this by interrogating the reference before each
call to insure that it supports a particular method. Since
every call to a late bound object actually requires two
calls ("Do you do this?" followed by "Okay, do it then"),
late binding is much less efficient than early binding.
Except where early binding is not supported (ASP,
scripting, etc.), late binding should only be used in very
special cases.

It is a common misconception that any code using the
CreateObject function instead of Set = New is using late
binding. This is not the case. The type declaration of
the object variable determines whether it is late or early
bound, as in the following:

Dim A As Foo
Dim B As Foo
Dim C As Object
Dim D As Object

Set A = New Foo 'Early Bound
Set B = CreateObject("FooLib.Foo") 'Early Bound
Set C = CreateObject("FooLib.Foo") 'Late Bound
Set D = New Foo 'Late Bound

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I change the color of a form in visual basic?

475


What do you mean by Databound Controls Explain?

1422


What is executenonquery in vb net?

502


Explain the working with task in Gantt chart view.

555


What is shortcut menu and explain "The ole control's shortcut menu".

552






Explain the usage of Web Browser Control?

1483


What is understand in resource tracking?

672


Is visualvm free?

545


___ VB constant make the menu item in centre.

1336


What is controls in vb?

535


Is visual basic case sensitive?

594


how to use telugu language in vb6? any unicode data is available for telugu or not?yes means how to use? my desired output is telugu only? i am doing project like(telugu calendar),my output should be print in telugu only? pls send me the solution with code?

2992


Explain about creating VB applications in excel?

661


____ property of menu cannot be set at run time.

1160


How would you attach pictures in column headers of List View Control?

1652