Calling C++ DLL in C# RRS feed

  • Question

  • Hello,

    I am having C++ application with multiple functions (No Class ) in  it.

    I built this application as a DLL.

    Also I am having a c# application in which I want to call 2-3 functions from built C++ DLL.

    I am using following code to call a C++ function from C#;

    using System.Runtime.InteropServices;

    [DLLImport dllName]

    public static extern function1(param1, param2, ...);

    [DLLImport dllName]

    public static extern function2(param11, param22, ...);

    So, Is there any other way to do this instead of doing DLLImport for multiple times?

    Is it possible to register a C++ DLL and use it in C# application without using DLLImport?



    Thursday, January 13, 2011 9:05 AM


All replies