.NET Framework Bookmark and Share   
 index > .NET Base Class Library > Using dll
 

Using dll

Hi!
I'm a newbie to C#, I have a dll and it contains several functions, Please tell me how can I include that dll into my project and use those functions???
I'm using VS 2008

Please help.

Regards.

Rashdan
Rashdan
If it is not a .NET dll, you need to know the signatures of functions contained in the dll (from document or people who gives you the dll), and then import those functions to C# code, it is a big topic, but this article may fit for you.

Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.
  • Marked As Answer byRashdan Tuesday, September 22, 2009 8:52 AM
  •  
eryang
You'll want to add a reference to the DLL in your project. In the Solution Explorer, right click on References, and choose Add Reference... then pick your DLL.

If it's a .NET assembly, this will add a reference to your project. You can then import the namespace of the type you want to use, and use it in your project:

using NamespaceFromDLL ;

//...

void Main()
{
TypeFromDLL newType = new TypeFromDLL(); // Use the type from the DLL as any other type now.
}

Reed Copsey, Jr. - http://reedcopsey.com
  • Marked As Answer byRashdan Tuesday, September 22, 2009 8:52 AM
  • Unmarked As Answer byRashdan Tuesday, September 22, 2009 8:52 AM
  • Proposed As Answer byRudedog2 Friday, September 18, 2009 11:02 PM
  •  
Reed Copsey, Jr.
If it is not a .NET dll, you need to know the signatures of functions contained in the dll (from document or people who gives you the dll), and then import those functions to C# code, it is a big topic, but this article may fit for you.

Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.
  • Marked As Answer byRashdan Tuesday, September 22, 2009 8:52 AM
  •  
eryang
Thanks , the article helped.
Rashdan
Rashdan

You can use google to search for other answers

Custom Search

More Threads

• Download a pdf file from IE
• Deserialize - Index was outside the bounds of the array.
• BackgroundWorker.RunWorkerCompleted - Errors and exceptions not being caught inside DoWork
• .NET Framework 2.0 Service Pack Release?
• System.IO.File.Encrypt()
• How to release metafile
• Active directory search using "contains" operation ?
• How to encrypt Properties.Settings.Default?
• System.ObjectDisposedException: Cannot read from a closed TextReader.
• Internet Explorer Context Menu