2013-05-02 154 views
1

这是虽然提到CDSDK.dll我收到错误:我想使用一个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. 

的erorr是这是我的项目通过PC来控制我的佳能相机的一部分,一个名为CAMERA.cs。

我错过了这个DLL文件,所以我从两个地方下载了两次。 在第一时间的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 

然后我下载的第二个文件是298KB,他给了我现在这个错误。

唯一的例外是在CAMERS.cs上线人数929:

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

这是更新包括两名directores到我的解决方案/项目的链接我的SkyDrive:

CDSDK1和CDSDK2在每个有是cdsdk.dll文件一个是928kb左右,其他300kb左右。

每一个都给出了一个不同的错误。

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

项目名称以下载:Canon_Camera_Control

这是塞康CDSDK.dll文件的完整异常消息:检测

PInvokeStackImbalance 消息:一个调用函数的PInvoke 'Canon_Camera_Control!RDC.CameraSDK.cdAPI :: CDStartSDK'已经不平衡了堆栈。这很可能是因为托管的PInvoke签名与非托管目标签名不匹配。检查PInvoke签名的调用约定和参数是否与目标非托管签名相匹配。

我现在搜索了很多关于这个错误的信息,并没有找到任何线索。

+0

检查PInvoke签名的调用约定和参数是否与目标非托管签名相匹配。告诉我们你的声明。 – SLaks 2013-05-02 21:05:28

+1

我不是专家,但使用谷歌搜索“pinvoke已经失去了平衡”,三个热门点击都在这里。做任何这些帮助吗? http://stackoverflow.com/questions/2941960/a-call-to-pinvoke-function-has-unbalanced-the-stack http://stackoverflow.com/questions/9855438/a-call-to-a -pinvoke-function-has-unbalanced-the-stack http://stackoverflow.com/questions/15255474/a-call-to-pinvoke-has-unbalanced-the-stack-dll-import-fails-even-with -cdecl – neminem 2013-05-02 21:06:49

+0

这是一个CAMERA.cs代码的链接,我不确定声明在哪里。 http://pastebin.com/m9MvpfbE – 2013-05-02 21:09:10

回答