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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.