• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 510
  • Last Modified:

dll file to c#

how can I import a dll file to c# execute file?
I tried add to system but I couldn't. It is not accepting.
I tried the reflector...
How?
Thanks.
0
fancyfanta
Asked:
fancyfanta
1 Solution
 
Fernando SotoRetiredCommented:
If this is a .Net dll file just add a reference to the dll file from within Solution Explorer References node and then add a using statement to your code file.
0
 
systanCommented:
hi

use;
using System.Runtime.InteropServices;

sample;

[DllImportAttribute("user32.dll")] //DLL NAME
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); //DLL FUNCTION NAME TO BE USED

[DllImportAttribute("user32.dll")] //DLL NAME
public static extern bool ReleaseCapture(); //DLL FUNCTION NAME TO BE USED


The rest of the code is here;
http://www.experts-exchange.com/blogs/systan/B_3780-Drag-any-object-in-the-form-including-the-form-body.html

Open in new window

0
 
Russell_VenableCommented:
You may need to run it through OllyDbg and find the method through function list. This is a sure way to find out what it uses and sometimes the names and then you can use systan's example to import the functions.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now