Hi,
Could you please explain why and where late binding is used in .net with a few examples?
Thanks
Printable View
Hi,
Could you please explain why and where late binding is used in .net with a few examples?
Thanks
Hi
Simply don't late bind!
Calls on objects causes late binding that require extra work at runtime. Operators on objects causes late binding.
VB Code:
dim o,o1,o2 as object o = o1 + o2 '' late binding
Option Strict ON will catch late binding
Regards
Jorge
Hi,Quote:
Originally posted by Asgorath
Hi
Simply don't late bind!
Calls on objects causes late binding that require extra work at runtime. Operators on objects causes late binding.
VB Code:
dim o,o1,o2 as object o = o1 + o2 '' late binding
Option Strict ON will catch late binding
Regards
Jorge
I have the following function
[Highlight=VB]
Function standev(ByVal mean As Double, ByVal grades As Array) As Double
Dim x As Integer
Dim totaltop As Double = 0
For x = 0 To grades.Length - 1
totaltop = totaltop + (grades(x) - mean) * (grades(x) - mean)
Next
Return Math.Sqrt(totaltop / (grades.Length))
End Function
[vbcode
As you point out, with Option Strict On grades(x) is late binding.
However, if I cut and paste the entire sub code into a button_click event I have no problem.
Are you saying that it is the calling of the Sub which causes the problem? (Grades() is a form scope integer array).