lapucca
asked on
How do I use a C# dll in C++ COM application?
Hi, I have a C# dll that has different pulic static functions that i would like to use them in my C++ Com (unmanaged with only Win32 library) appliation. Can someone outline the steps I need to do to use these C# function?
Thank you.
Thank you.
You can use COM interop for that purpose. See http://msdn2.microsoft.com/en-us/library/zsfww439(VS.80).aspx ("Exposing .NET Framework Components to COM")
ASKER
My C# dll is a library project. Most of the functions and properties in it are public and static. I've been using this in my C# application without creating an instance of this library class. Is this a qualified candidate for COM interop? The url seems to be talking about creating an instance of the library class. Thank you.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here's more info on hosting the CLR:
http://msdn.microsoft.com/msdnmag/issues/06/08/CLRInsideOut/default.aspx
http://msdn.microsoft.com/msdnmag/issues/06/08/CLRInsideOut/default.aspx
tlbexp MyApp.dll /out:mytypelib.tlb
It will generate tlb file. You can use that tlb file in VC++. You can find tlbexp in .NET Framework direcotry i think.
Hope it helps
Thanks