G
[GHO]
Can some one send me a sample DLL file which wrote in C#
language.
language.
Can some one send me a sample DLL file which wrote in C#
language.
-----Original Message-----
Hi Yosi,
So, you need to read about interop, and exposing .net assemblies to COM.
In general you have to right-click on your project, select
Properties/Configuration properties/Build, and there change Register for
Com interop to true.
Than, when you build the assembly, it will be registered, and you can
use that classes.
Actually this is simplest solution for beginning. This way the assembly
will be registered only on the dev machine.
If you want to distribute this with your app on other machines there are
2 possible solutions:
1. use a setup project from VS.Net, and on the properties of the dll
(when you add it there) set Register = vsdrpCOM. It should make all
necessary preparations.
2. If the first solution fails (it happen to me, so now I use this),
your install script have to run:
regasm.exe mydll.dll /tlb:myddl.tlb /codebase /silent
/codebase registers the dll for COM interop without the need of putting
your dll in GAC. This is not the recommended by MS way, but you may use
it.
You can do it without /codebase, but then your install script have to
install the dll in GAC.
This are only shortcuts, but before doing such a things I strongly
recommend to read the articles in MSDN, related to Interop, like:
http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/vbcon/html/vbconcominteropinvisualbasicvisualc.asp
and search Google for more. I found this one helpful:
http://www.c- sharpcorner.com/Code/2002/April/COMInteropP2AJ.asp
Have fun
Cheers
Sunny
.