无法加载 DLL“testDLL.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。
就是这个错误,我已经把这个dll文件放到debug下了,怎么回事,请高手帮忙

解决方案 »

  1.   

    [DllImport("dll.dll", EntryPoint = "MUL", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] 
    public extern static int MUL(int i, int j);
      

  2.   

    兄弟,不行啊,怎么回事啊??    class Class1
        {
            [DllImport("testDLL.dll", EntryPoint = "Add", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
            public static extern double Add(double a, double b);
         }////////////////////////////////////////
            private void button1_Click(object sender, EventArgs e)
            {
                double c = WindowsApplication2.Class1.Add(4.0, 6.0);
                this.Text = c.ToString();
            }
      

  3.   

    namespace MathFuncs
    {
        class MyMathFuncs
        {
        public:
    // Returns a + b
            static __declspec(dllexport) double Add(double a, double b);        // Returns a - b
            static __declspec(dllexport) double Subtract(double a, double b);        // Returns a * b
            static __declspec(dllexport) double Multiply(double a, double b);        // Returns a / b
            // Throws DivideByZeroException if b is 0
            static __declspec(dllexport) double Divide(double a, double b);    };
    }
      

  4.   

    要么明确指明dll,就是使用绝对路径,或者把dll放在bin目录上级,因为从IDE中启动的exe是在这个目录下面执行的。
      

  5.   

    添加引用了没?
    add reference