heres the basics:
In the application that uses the .dll or control:
Early Bound:
Dim ThisObject As NameOfYourObject
OR
select the object from the refrences menu
With early binding the CLSID's and InterfaceID's of the object and its methods are compiled into the executable. Calls to this object will be made using the ID's. The Object will not be queried to see if the method being called exists. If the call does not match the declaration (correct # of arguments, etc..) an error occurs. If you are going to use early binding in your client apps you need to be compiling your components with binary compatibility to ensure that the old interfaces (clsid and iid's) will still be supported when you add functionality and recompile your .dll or control. The only problem with binary compatibility is that you cannot change the interface to an existing method (the # or type of arguments it takes, etc..
If you do the compatibility is broken and you will have to recompile all clients against the new .dll or control.
Late Bound:
Dim ThisObject As Object
Set ThisObject = CreateObject("SomeObject.SomeClass"
With late binding the IUnknown interface (a standard interface for all COM objects, automatically created by VB)
is queried to find a method by name when it is called. Changes to the interface do not require the clients to be recompiled.
so, the basic differences:
binary: can use early binding with this. If you recompile and don't get an error message from VB saying that your changes will break compatibility then it is safe to distribute the new component to client app's built against an earlier version of the .dll or control.
project: This doesnt preserve the ID's, therefore if a client app is early bound to the dll or control it will be compiled with the old ID's and will need to be recompiled whenever the control is. This kinda defeats the purpose of dll's. I always use binary compatibility.
I hope this was clear and helpful. If not post again and i will try to help.
Ruairi
Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.