Mfc dll file can use as unity plugin?

I have an MFC dll file and source project.
I wonder can i use it as an unity plugin file? Then how can I use it?
Need help.

In principle, you can use any DLL file as a plugin in Unity - this is a .NET feature, and is accessible via C# scripts.

You must write a C# script to import the functions, like this one:

using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;

public class MyDll : MonoBehaviour {

    [DllImport("MyDllFile")]
    public static extern int Function1(int v1);

    [DllImport("MyDllFile")]
    public static extern float Function2(float v2);
}

This script imports the functions Function1 and Function2 from the DLL file “MyDllFile.dll” stored in the Plugins folder.

Since the functions are defined as static in the MyDll script, you can use them in other scripts as MyDll.Function1(), MyDll.Function2() etc.

NOTE: Unfortunately, JS and CS scripts don’t see each other at compile time, thus JS users (like me) will have some trouble to use imported functions: it’s necessary to save the script above in the Plugins folder, and the JS scripts in some other folder compiled after Plugins (see Script Compilation to learn more about this).