How can I import and wrap dll in my C# application ?? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How can I import and wrap dll in my C# application ??

charlumerlucharlumerlu Posts: 6Member
The question is in the subject.... thanks for any help !

Comments

  • charlumerlucharlumerlu Posts: 6Member
    : The question is in the subject.... thanks for any help !
    :

    [DllImport("DllName.dll")] public static extern "return type" dllFunctionPrototype("types and parameters");
  • hunghung Posts: 1Member
    : : The question is in the subject.... thanks for any help !
    : :
    :
    : [DllImport("DllName.dll")] public static extern "return type" dllFunctionPrototype("types and parameters");
    :

    Your dll maybe look like this:
    namespace DllName //your namespace
    {
    public class MyDll //your class
    {
    public MyDll () //your constructor
    {
    .....
    }
    ...
    }
    }

    If you want to import your dll to your application I think you
    just add it as a reference to your application:
    Project -> Add Reference -> (.NET) Browse... -> DllName.dll
    (or Right Click on "Solution Explorer" -> Add Ref ...)

    Your application:

    using ...;
    using DllName;
    ......
    MyDll md= new MyDll ();
    md.yourMethod ();
    ......

    Maybe it is the solution for your problem!!!!
Sign In or Register to comment.