I did up this small late binding sample for a colleague last night and I thought I may as well share it with the rest of the world. If you have ever wanted to see how late binding to a COM object works this sample solution is the place to look.
The solution includes two projects, one a sample COM object to late bind to, the second is a console application that late binds to the COM object and makes a method call.
I know this stuff is not rocket science, and is even explained (somewhere) in MSDN, this should save some digging and time.
Of course I should mention the pitfalls that can occur with this type of late binding. It’s slow, very slow, very very slow compared to early binding, so use it wisely, and only after careful consideration.
Download Late Binding Sample