今天开始写c#

来源:互联网 发布:app内购 元数据丢失 编辑:程序博客网 时间:2024/05/10 03:43

PT-60的dll无法在C#里面引用

只能使用DllImport了

 

添加using System.Runtime.InteropServices;

 

然后在class里面添加

[DllImport("scanapiax.dll", EntryPoint = "PT_EnableScanner")]
public static extern int PT_EnableScanner();
[DllImport("scanapiax.dll", EntryPoint = "PT_DisableScanner")]
public static extern void PT_DisableScanner();
[DllImport("scanapiax.dll", EntryPoint = "PT_CheckBarcodeData")]
public static extern bool PT_CheckBarcodeData();
[DllImport("scanapiax.dll", EntryPoint = "PT_GetBarcodeData")]
public static extern bool PT_GetBarcodeData(ref uint uiBarType, byte[] pBuffer, ref uint uiMaxBufferLen);
[DllImport("scanapiax.dll", EntryPoint = "PT_SetDefault")]
public static extern bool PT_SetDefault();

 

以后就可以直接在下面引用相关函数了

 

这个问题算是解决了,

 

今天的提问:program.cs到底是干嘛的?继承窗体又是怎么回事?

原创粉丝点击