Solved

dll file to c#

Posted on 2011-02-20
3
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 63

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 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