apm said:
Building COM components with .NET is tricky business.
No, it's not. Actually it's just as simple to build COM components in .NET
than it is in VB6 f.i. The only tricky thing is to keep an eye on the
requirements imposed by COM.
Components need
_strong names_ and must be placed in the GAC. After all that they won't
run on older computers.
Not true, your private assemblies do't have to be signed and they don't have
to be in the GAC. Public assemblies can better be signed (but this is not
imposed), but don't have to be in the GAC either, you can register them
using the /codebase option.
It would be great if C# could be used to make _native_
COM components. I suspect it is possible in _unsafe_ mode with a very
large amount of work.
C# is targetting a managed environment, building native code is not what it
was designed for, so building native COM was certainly not why .NET was
invented for, why should it, there are still tools arround to build native
COM (C++, VB6, Delphi, ...).
Building native COM using "unsafe mode" is NOT possible, unsafe doesn't mean
native.
The last time I made .NET components and exposed them to COM the app ran
very slowly. What can cause this and has the performance improved? I used
version 1.0.
Transitioning between managed/unmanaged code has some overhead, but when
done correctly , this overhead is negligible.
Willy.