COM Interop question 
Author Message
 COM Interop question

If i reference a COM component in my application, a file called
interop.name.dll is created in the application directory. Will my
application work if i run the application on another machine where the dll
is present and registered, but on another location in the filesystem?

Regards

Niclas



Tue, 22 Nov 2005 17:45:39 GMT  
 COM Interop question
I am presuming that the application and the COM object are
on the same machine and that there are no DCOM issues.  
The process of registering the component using regsvr32
stores the path to the component in registry for that
machine.  In .NET you can then add a reference and
instantiate the COM object with new operator.  .NET
created a RCW (runtime callable wrapper) for you.  .NET
looks after the rest.

cheers

Peter

Quote:
>-----Original Message-----
>If i reference a COM component in my application, a file
called
>interop.name.dll is created in the application directory.
Will my
>application work if i run the application on another

machine where the dll
Quote:
>is present and registered, but on another location in the
filesystem?

>Regards

>Niclas

>.



Tue, 22 Nov 2005 19:37:14 GMT  
 COM Interop question
That's not what he asked. He asked if he makes a reference to the COM object
on one machine and then places the referenced DLL in another directory on a
different machine, will the program work.

The answer is NO

When you make a reference to a COM object and your program points to a
specific path where the typelibrary -- not the CLSID -- says it resides. If
the two do not marry up, you get a 429 -- which is what I suspect your
getting.

In VB6, when you reference WMI on a Windows XP machine and port it over to a
2000 machine the program will fail for the same exact reason. The Typelib
reference points to the Windows Directory and not the WINNT Directory.

This is where early binding fails and where simply creating the object at
runtime provides an easy answer for blind portability.


Quote:
> I am presuming that the application and the COM object are
> on the same machine and that there are no DCOM issues.
> The process of registering the component using regsvr32
> stores the path to the component in registry for that
> machine.  In .NET you can then add a reference and
> instantiate the COM object with new operator.  .NET
> created a RCW (runtime callable wrapper) for you.  .NET
> looks after the rest.

> cheers

> Peter

> >-----Original Message-----
> >If i reference a COM component in my application, a file
> called
> >interop.name.dll is created in the application directory.
> Will my
> >application work if i run the application on another
> machine where the dll
> >is present and registered, but on another location in the
> filesystem?

> >Regards

> >Niclas

> >.



Wed, 23 Nov 2005 15:54:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Com Interop question on Aliasing Attributes ?

2. Com Interop Questions

3. COM Interop Question

4. COM Interop question: Are arrays of VB6 user defined types blittable?

5. .NET to COM Interop with VSS - Deployment Question

6. Automation error referencing .net dll from com (com interop)

7. Strong named COM Interop

8. ParamArray and COM Interop

9. COM / .NET interop

10. COM Interop

11. VB.NET COM Interop -vs- VB6 ---- The Turtle And The Hare

12. .Net browser control wrapper...will there be one?, com interop is crap

 

 
Powered by phpBB® Forum Software