问题描述
我想主要使用zbar在IOS中读取条形码。这也可能与Windows交叉平台。我下载了libzbar.dll并试图通过dumpbin / export将我列出的方法Pinvoke。
我得到一个Pinvoke堆栈不平衡异常(?)。 />
问题是
1)如何避免堆栈不平衡?即如何在dll中找到方法的参数?
2)我为IOS构建时是否可以使用* .dll文件或者我可以在所有?
除此之外,任何关于使用libzbar.a进行跨平台开发的信息都表示赞赏。
谢谢
Hi ,
I want to use the zbar for barcode reading in IOS primarily. This may be cross platformed to windows too. I downloaded the libzbar.dll and tried to Pinvoke the methods which I listed via dumpbin /export.
I am getting a Pinvoke stack imbalance exception (?).
The questions are
1) How to avoid the stack imbalance? ie how to find the parameters for methods in the dll?
2) Is it ok to use *.dll file when I build for IOS or Can I do that at all?
Other than that any info on using a libzbar.a for cross platform development is appreciated.
Thanks
推荐答案
In your PInvoke DllImport attribute, please change the CallingConvention to Cdecl or StdCall, this will solve your problem.
Hope it helps.
这篇关于使用libzbar.dll或libzbar.a在c#中使用zbar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!