>I have a problem that I have a COM dll and i need to access the
>methods in that dll. But what is required here is that the dll needs
to be added as a reference only during runtime and not like they are
generally added (Project-->Add Reference-->COM). Is it possible to do
that?
Well a reference is by definition a compile time thing. But you can
certainly instantiate COM objects dynamically at runtime and call them
assuming they support late binding with IDispatch.
Use Type.GetTypeFromProgID/CLSID to find the COM type, instantiate
with Activator.CreateInstance and call its methods using reflection
(Type.InvokeMember etc).
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com
Please reply only to the newsgroup.