无法加载 DLL“MapLicenseXP.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。可能会是什么原因?谢谢!或者怎样找到问题!

解决方案 »

  1.   

    代码:              [DllImport("MapLicenseXP.dll")]
            public static extern bool WriteMapLicenseCode(char[] a,  Byte[] b, int c);        private void button8_Click(object sender, EventArgs e)
            {
                string aa = "E:\\NET程序\\开发\\DataManage\\Map.ext";
                Byte [] b = new byte[512];
                char[] a = aa.ToCharArray();
                int c = 512;
                if (WriteMapLicenseCode(a, b, c))
                {
                    MessageBox.Show("T");
                }
            }
      

  2.   

    你的 MapLicenseXP.dll 是不是在当前文件夹中?
      

  3.   

    dll中的函数和参数:
    MAPLICENSE_API bool WriteMapLicenseCode(TCHAR * pszMapFile, BYTE * pbyCode, int nCodeLen);
      

  4.   

    MapLicenseXP.dll dll是否已经放到了运行目录下??
      

  5.   

    MapLicenseXP.dll 我放置到了:...\bin\Debug 下了。
    谢谢各位!
      

  6.   

    试试  csc /r:MapLicenseXP.dll
      

  7.   

    参数 BYTE * pbyCode 是一个传出参数,我这样定义:WriteMapLicenseCode(a, ref b, c)也不行,请高手们帮帮忙!
      

  8.   

    csc /r:MapLicenseXP.dll;也不行。另外一个dll就没有问题,放置的地方,和调用的方式一摸一样。这是为何?
      

  9.   

    你在windows的"开始"菜单栏中的"运行"那里运行一下以下的命令regsvr32 "DLL的地址" 注册后就可以引用了.
      

  10.   

    public static extern bool WriteMapLicenseCode(char[] a,  Byte[] b, int c);
    a,b的类型不对。
      

  11.   

    dumpbin 看看dll中有没有WriteMapLicenseCode
      

  12.   

    要么放到system32文件夹下,要么绝对路径引用.
      

  13.   

    是不是这个Dll需要在操作系统下用Regsvr32命令来注册一下啊!