简体   繁体   English

从 DLL 调用 function 时出现 System.EntryPointNotFoundException

[英]System.EntryPointNotFoundException when calling function from DLL

I am trying to use an external DLL library.我正在尝试使用外部 DLL 库。 All the functions that I used so far are working fine except for this one function which throws an EntryPointNotFoundException到目前为止,我使用的所有功能都可以正常工作,除了这个 function 会引发EntryPointNotFoundException

I tried using VS dumpbin and I can find the function's name in the exports我尝试使用 VS dumpbin,我可以在导出中找到函数的名称

垃圾箱结果

My dllimport code我的dllimport代码

[return: MarshalAs(UnmanagedType.I1)]
[DllImport(DLLPATH, EntryPoint = prefix + "APIConfigureEyeMeasurements"]
protected static extern bool ConfigureEyeMeasurements(byte instance, bool doTopMeasurements, bool doBaseMeasurements, bool doMin,
                                      bool doMax, bool doRiseTime, bool doFallTime, bool doPeakToPeak,
                                      bool doEyeAmplitude, bool doEyeHeight, bool doEyeWidth, bool doCrossingPercentage, bool doJitter, bool doSNR, bool doVEC, bool doTDEC);

The function from its header file: function 来自其 header 文件:

bool __stdcall APIConfigureEyeMeasurements(
    byte instance,
    bool doTopMeasurements, bool doBaseMeasurements, bool doMin,
    bool doMax, bool doRiseTime, bool doFallTime, bool doPeakToPeak,
    bool doEyeAmplitude, bool doEyeHeight, bool doEyeWidth,
    bool doCrossingY, bool doJitter, bool doSNR, bool doVEC, bool doTDEC);

Could it be something caused by the parameters or from the import that I am using.可能是由参数或我正在使用的导入引起的。 The strange thing is that all the other functions are working fine奇怪的是所有其他功能都运行良好

Your C# declaration has 16 arguments, each of which consume 4 bytes of stack space.您的 C# 声明有 16 个 arguments,每个占用 4 个字节的堆栈空间。 Therefore the postfix should be @64 .因此后缀应该是@64 It is actually @68 which means that your declaration of the function is incorrect.它实际上是@68 ,这意味着您对 function 的声明不正确。 You are probably missing an argument, or have misdeclared the type of an argument, which I am sure you will discover if you double check with the C++ header file.你可能遗漏了一个参数,或者错误地声明了一个参数的类型,如果你仔细检查 C++ header 文件,我相信你会发现。

Ah, I've just re-read the question right the way to the end, and seen that the header file is also missing an argument.啊,我刚刚从头到尾重新阅读了这个问题,发现 header 文件也缺少一个参数。 So it seems like you will need to get in touch with the developer of the DLL to resolve this issue.因此,您似乎需要与 DLL 的开发人员联系以解决此问题。 The DLL that you are using does not match the header file that you have.您使用的 DLL 与您拥有的 header 文件不匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从C#调用C ++代码时出现System.EntryPointNotFoundException - System.EntryPointNotFoundException when calling C++ code from C# 未处理的异常:DLL中的System.EntryPointNotFoundException - Unhandled Exception: System.EntryPointNotFoundException in DLL 尝试从C#调用非托管函数时出现'System.EntryPointNotFoundException' - 'System.EntryPointNotFoundException' when trying to call unmanaged function from C# 使用aff文件时System.EntryPointNotFoundException - System.EntryPointNotFoundException when using aff file System.EntryPointNotFoundException和DllImport(“ kernel32.dll”) - System.EntryPointNotFoundException and DllImport(“kernel32.dll”) System.EntryPointNotFoundException: ''Gdi32.dll' DLL'sinde 'CreateRoundRecRgn' 未找到' - System.EntryPointNotFoundException: ''Gdi32.dll' DLL'sinde 'CreateRoundRecRgn' not found' System.EntryPointNotFoundException以平行红色显示在输出中 - System.EntryPointNotFoundException in Parallel red in output System.EntryPointNotFoundException:无法找到入口点 - System.EntryPointNotFoundException: Unable to find an entry point Mono 2.8上的SWIG中的System.EntryPointNotFoundException错误 - System.EntryPointNotFoundException error in SWIG on mono 2.8 在Linux中,单声道调用我的.so lib返回System.EntryPointNotFoundException - in linux, mono invoke my .so lib return System.EntryPointNotFoundException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM