Click to See Complete Forum and Search --> : How do I use a DLL with C#?
jmason309
February 10th, 2006, 01:59 PM
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
MadHatter
February 10th, 2006, 02:24 PM
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);
jmason309
February 10th, 2006, 02:30 PM
Thanks MadHatter. I'll give it a shot. I have a lot to learn here.
Thanks Again,
Jim
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.