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

The question is in the subject.... thanks for any help !

Comments

  • : The question is in the subject.... thanks for any help !
    :

    [DllImport("DllName.dll")] public static extern "return type" dllFunctionPrototype("types and parameters");
  • : : 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.

Howdy, Stranger!

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

Categories

In this Discussion