简体   繁体   English

我正在尝试使用dll文件名:CDSDK.dll,但出现错误,此错误是什么?

[英]I'm trying to use a dll file name: CDSDK.dll but getting an error what is this error?

This is the error I am getting while referencing the CDSDK.dll: 这是我在引用CDSDK.dll时遇到的错误:

    A call to PInvoke function 'Canon_Camera_Control!RDC.CameraSDK.cdAPI::CDStartSDK' has unbalanced the stack. 
This is likely because the managed PInvoke signature does not match the unmanaged target signature. 
Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

The erorr is on a file called CAMERA.cs it's a part of my project to control my canon camera through the pc. erorr位于名为CAMERA.cs的文件中,这是我通过PC控制佳能相机的项目的一部分。

I was missing this dll file so i downloaded it twice from two places. 我缺少此dll文件,因此我从两个地方下载了两次。 At the first time the dll file was 300kb and gave an error but the program didn't stop i used my logger to log out the error: 第一次,dll文件为300kb并出现错误,但程序没有停止,我使用了我的记录器来注销错误:

5/2/2013--11:02 PM ==> Error! CDStartSDK C000060
5/2/2013--11:02 PM ==> Error! CDEnumDeviceReset C0000F1
5/2/2013--11:02 PM ==> Error! CDFinishSDK C0000F1

Then i downloaded the second file which is 298kb and he gave me this error now. 然后我下载了第二个文件298kb,他现在给了我这个错误。

The exception is on CAMERS.cs on line number 929: 例外是CAMERS.cs,行号929:

err = (UInt32)cdAPI.CDStartSDK(ref Version, 0);

This is a link to my solution/project on my SkyDrive updated including two directores: 这是我的SkyDrive更新后的解决方案/项目的链接,其中包括两个导演:

CDSDK1 and CDSDK2 in each there is the cdsdk.dll file one is 928kb or so and other 300kb or so. 每个CDSDK1和CDSDK2中都有cdsdk.dll文件,一个为928kb左右,另一个为300kb左右。

Each one give a different error. 每个给一个不同的错误。

https://skydrive.live.com/redir?resid=EB1C71C44C3976D5!202&authkey=!AAe7QvxIzBMne1Q https://skydrive.live.com/redir?resid=EB1C71C44C3976D5!202&authkey=!AAe7QvxIzBMne1Q

The project name to download is: Canon_Camera_Control 要下载的项目名称是:Canon_Camera_Control

This is the complete exception message for the secon CDSDK.dll file : 这是secon CDSDK.dll文件的完整异常消息:

PInvokeStackImbalance was detected Message: A call to PInvoke function 'Canon_Camera_Control!RDC.CameraSDK.cdAPI::CDStartSDK' has unbalanced the stack. 检测到PInvokeStackImbalance消息:对PInvoke函数'Canon_Camera_Control!RDC.CameraSDK.cdAPI :: CDStartSDK'的调用已使堆栈不平衡。 This is likely because the managed PInvoke signature does not match the unmanaged target signature. 这可能是因为托管PInvoke签名与非托管目标签名不匹配。 Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. 检查PInvoke签名的调用约定和参数是否与目标非托管签名匹配。

I googled so deep now and didn't find any clue/s about this error/s. 我现在在Google上进行了深入的搜索,没有找到有关此错误的任何线索。

You have the wrong p/invoke signature. 您的p / invoke签名错误。 Try unsing the P/Invoke Interop Assistant utility ( http://clrinterop.codeplex.com/releases/view/14120 ) to automatically generate the correct marshalling attributes. 尝试取消使用P / Invoke Interop Assistant实用程序( http://clrinterop.codeplex.com/releases/view/14120 ),以自动生成正确的编组属性。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM