differten call of COM-Objects

  • Thread starter Thread starter aaapaul
  • Start date Start date
A

aaapaul

Hello !

Can anybody tell me, whats the difference between these two classes ?


Public Class clsOutlook

Private objAppOutlook As Object

Sub New()
objAppOutlook = CreateObject("Outlook.Application")
End Sub

End Class



Public Class clsOutlook

Private objAppOutlook As Outlook.Application

Sub New()
objAppOutlook = new Outlook.Application
End Sub

End Class

Thanks
aaapaul
 
In the first case you are using late binding because the variable is declared
as 'object'. In the latter case you are using early binding (i.e. compile
time binding) which in most cases gives you better performance.

HTH, Jakob.
 
Back
Top