qq_39282167
简单0×
2020-03-24 14:55
采纳率: 100%
浏览 620

函数名没问题,可以编译,在进入运行后,使用该功能会中断运行,说在IDCard.dll中无法找到SDT_OpenPort的入口点?

    [DllImport("IDCard.dll", EntryPoint = "SDT_GetCOMBaud", CharSet = CharSet.Ansi)]
    public static extern int SDT_GetCOMBaud(int iPort, ref uint puiBaudRate);
    [DllImport("IDCard.dll", EntryPoint = "SDT_OpenPort", CharSet = CharSet.Ansi)]
    public static extern int SDT_OpenPort(int iPort);

            [DllImport("IDCard.dll", EntryPoint = "SDT_SetCOMBaud (int iPort, uint uiCurrBaud, uint uiSetBaud)SDT_OpenPort", CharSet = CharSet.Ansi)]
    public static extern int SDT_SetCOMBaud(int iPort);
    [DllImport("IDCard.dll", EntryPoint = "SDT_ClosePort", CharSet = CharSet.Ansi)]
    public static extern int SDT_ClosePort(int iPort);

 private void button4_Click(object sender, EventArgs e)
        {
            IDCardData CardMsg = new IDCardData();
            int nRet, nPort;
            string stmp;
            byte[] cPath = new byte[255];
            byte[] pucIIN = new byte[4];
            byte[] pucSN = new byte[8];
            nPort = m_iPort;

                    if (SDT_OpenPort(nPort) == 0)

         }

哪位指点下迷津,究竟是哪里除了问题

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • caozhy
    已采纳

    用depend打开IDCard.dll看看,有没有SDT_OpenPort的导出函数
    还有就是32bit/64bit是否匹配,主程序和dll要相同架构

    点赞 评论

相关推荐