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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top