Tutorial Downloads .com

Home

What is meant by "Early Binding" and "Late Binding" Which is better | Visual basic

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

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


Resource:
Posted By : naina
On date : 07.25.08

Most used Visual Basic ( VB ) Tutorials

Visual Basic Tutorial ( Ebooks , PDF's )
Visual Basic 6 Tutorial Download Visual Basic.Net Practical Standards For Microsoft Visual Basic Microsoft Visual Basic Design Patterns
VB Interview Questions & Answers
differences between flexgrid control and dbgrid, at is difference between inprocess and out of process, What is a Component?How to register a component?What are the Control Categories Difference between Dynaset and Snapshot? Difference Declaration and Instantiation an object? What is a Type Library and what is it's purpose ? What is DBFailError?What is DBSqlPassThrough? .... etc... etc....
What is the max size allowed for Msgbox Prompt and Input Box | Visual basic Question
What is the max size allowed for Msgbox Prompt and Input Box in VB
Microsoft Visual Basic 2008 Step by Step tutorial
This is a VB tutorial book which describes Microsoft Visual Basic 2008 Step by Step
Difference between a function and a subroutine | VB Interview question
Difference between a function and a subroutine
Difference between listbox and combo box | VB Interview question
Difference between listbox and combo box
Diff types of Lock Types in Vb
Diff types of Lock Types
What are the three main differences between flexgrid control and dbgrid(Data bound Grid) control
What are the three main differences between flexgrid control and dbgrid(Data bound Grid) control
Advantage of ActiveX Dll over Active Exe
Advantage of ActiveX Dll over Active Exe
DIFF between Image and Picture box controls | VB Question
DIFF between Image and Picture box controls?
ActiveX and Types of ActiveX Components in VB
ActiveX and Types of ActiveX Components in VB
Difference between Dynaset and Snapshot | VB Interview question
Difference between Dynaset and Snapshot
What are the RDO Methods and Events in VB
What are the RDO Methods and Events
Difference Query unload and unload in form | VB Interview question
Difference Query unload and unload in form
What is meant by "Early Binding" and "Late Binding" Which is better | Visual basic
What is meant by "Early Binding" and "Late Binding"? Which is better?

Latest added Visual Basic ( VB ) Tutorials

Microsoft Visual Basic 2008 Step by Step tutorial
This is a VB tutorial book which describes Microsoft Visual Basic 2008 Step by Step
What are the RDO Methods and Events in VB
What are the RDO Methods and Events
Diff types of Lock Types in Vb
Diff types of Lock Types
What is the max size allowed for Msgbox Prompt and Input Box | Visual basic Question
What is the max size allowed for Msgbox Prompt and Input Box in VB
What is the purpose of the ClipControls property on a form or container | VB Question
What is the purpose of the ClipControls property on a form or container
What is the difference in passing values ByRef or ByVal to a procedure | VB Question
What is the difference in passing values ByRef or ByVal to a procedure
Describe and In Process vs. Out of Process component. Which is faster | VB Question
Describe and In Process vs. Out of Process component. Which is faster
different compatibility types when creating a COM component | VB Interview Question
different compatibility types when creating a COM component
Name the four different cursor and locking types in ADO and describe them briefly
Name the four different cursor and locking types in ADO and describe them briefly
What are binary and project compatibility | VB Question
What are binary and project compatibility