How do I use a DLL with C#?
I am trying to use a DLL created with Visual Studio 6.0 from my C# application created with Visual Studio.NET 2003. As soon as I go to add a reference I get "A reference could not be added...Not a valid assembly or COM component..."
If you can help me, please reply.
Thanks,
Jim Mason
Re: How do I use a DLL with C#?
1. register it w/ com
2. wrap it in C++ w/ .net
3. use system.runtime.interopservices to do a DllImport for each function you need.
ex: Playsound
[DllImport("winmm.dll")]
public static extern bool PlaySound(string sound, IntPtr module, int soundFlags);
Re: How do I use a DLL with C#?
Thanks MadHatter. I'll give it a shot. I have a lot to learn here.
Thanks Again,
Jim