Solved

dll file to c#

Posted on 2011-02-20
3
500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 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