Ben Voigt [C++ MVP]
6/9/2007 5:42:00 PM
"Roger Tranchez" <run1789@community.nospam> wrote in message
news:77F5B5E0-0126-4A4B-B338-2FD18790F036@microsoft.com...
> Hello,
>
> One of our enterprise applications must have a reference to a tlb file
> that
> exposes methods from a COM component residing on our local network.
>
> Not all the users of that application will have to use the functionality
> of
> that COM component, thus, it will be no necessary to load always that COM
> component. In fact, not all the users have access to the network share
> where
> this component resides.
>
> My question is, How can I dinamically load a COM component ? I know I can
> do
> it with NET assemblies or wrapped COM assemblies, but I need to do it
> directly from that TLB /DLL file on the network as the file is inlaid
> with
> software LICENSES to it (strange but true).
Not at all strange. You haven't got a development license for the COM
component, apparently, but you have a license for another control or
component that uses that component internally. You should only use the
component you have a license for.
If you do have a development license for the component, you will need to use
the Visual Studio support to embed a runtime license into your application.
Since you don't want that component always used, create a class library
(assembly/dll) that has an ActiveX reference to the component and the right
license, put the code for creating the component there, then dynamically
load that .NET assembly in the usual way.
>
> Thanks in advance,
>
> --
> Roger Tranchez
> MCTS
> .NET 2005 and DB developer