|
-
February 10th, 2006, 02:59 PM
#1
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
-
February 10th, 2006, 03:24 PM
#2
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);
Last edited by MadHatter; February 10th, 2006 at 03:30 PM.
-
February 10th, 2006, 03:30 PM
#3
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|