Solved

dll file to c#

Posted on 2011-02-20
3
493 Views
Last Modified: 2013-12-17
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
Comment
Question by:fancyfanta
3 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 34937519
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
 
LVL 14

Accepted Solution

by:
systan earned 500 total points
ID: 34938392
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
 
LVL 15

Expert Comment

by:Russell_Venable
ID: 34946256
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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now