成功Message=无法加载 DLL“XXX”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)解决

private void frmScanM_Load(object sender, EventArgs e)
        {
            RFIDLIB.rfidlib_reader.RDR_LoadReaderDrivers("C:\\Drivers");

//获取驱动数量
            UInt32 nCount;
            nCount = RFIDLIB.rfidlib_reader.RDR_GetLoadedReaderDriverCount();
            uint i;
            for (i = 0; i < nCount; i++)
            {
                UInt32 nSize;
                CReaderDriverInf driver = new CReaderDriverInf();
                StringBuilder strCatalog = new StringBuilder();
                strCatalog.Append('\0', 64);
           }
}

调用dll文件:

public static extern int RDR_LoadReaderDrivers(string drvpath);

[DllImport("rfidlib_reader.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)

备注:C:\\Drivers这个文件夹存在,却提示找不到模块,原因是bin目录下缺少这个dll文件,把文件rfidlib_reader.dll拷贝到bin目录下搞定。

(0)

相关推荐