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/de...l=/library/en-
us/vbcon/html/vbconcominteropinvisualbasicvisualc.asp
and search Google for more. I found this one helpful:
http://www.c-sharpcorner.com/Code/20...nteropP2AJ.asp
Have fun
Cheers
Sunny
In article <e8**************@TK2MSFTNGP09.phx.gbl>,
yo*****@taux01.nsc.com says...
I know All you sent me, but my problem is to create a general DLL, as on
MFC to be able to use it from any application not only C# application.
I always create MFC DLL , then add the *.lib then
"exten myDLLfunc()" , then copy my DLL to Aplication directory,
Now I can use this function.
Now what I'm asking for is how to do that by using C# language to create
a DLL file then using this DLL on MFC application
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!