[疑难问答] 请教!PC机连接MA101源码失败。

[复制链接]
1942|0
 楼主| 快乐一个人 发表于 2015-7-16 09:35 | 显示全部楼层 |阅读模式

  1. <P> typedef struct  _MW_BridgeMini
  2. {
  3.     DWORD VID;           // Need to match user device's "Vendor ID".
  4.     DWORD PID;           // Need to match user device's "Product ID".
  5.     DWORD ReadTimeOut;          // Specifies the read data time-out interval, in milliseconds.
  6.     DWORD WriteTimeOut;          // Specifies the write data time-out interval, in milliseconds.   
  7.     HANDLE Handle;                      // Do not modify this value, reserved for DLL

  8. } MW_BridgeMini;</P>
  9. <P> </P>
  10. <P> </P>
  11. <P>
  12.   HINSTANCE HWND_DLL;

  13.      MW_BridgeMini BridgeObj;</P>
  14. <P>  CString m_strVid;
  15.   CString m_strPid;</P>
  16. <P>  DWORD dwResult = 0;</P>
  17. <P>  DWORD index = 1;</P>
  18. <P>  typedef int (*MyFun)(MW_BridgeMini,DWORD);
  19.   MyFun MyFun_1;</P>
  20. <P>
  21.   m_strVid = "0E6A";
  22.   m_strPid = "0103";</P>
  23. <P>  HWND_DLL = LoadLibrary("BridgeMini.dll");</P>
  24. <P>  BridgeObj.VID = HexStrToDW(m_strVid); //字符串转换为整型
  25.   BridgeObj.PID = HexStrToDW(m_strPid); //字符串转换为整型
  26.   BridgeObj.ReadTimeOut =  0xfffffff; // for demo purpose  默认
  27.   BridgeObj.WriteTimeOut = 0xfffffff;// for demo purpose   默认</P>
  28. <P>
  29.   MyFun_1 = (MyFun)GetProcAddress(HWND_DLL,"MA101_ConnectBridge");</P>
  30. <P>  dwResult = MyFun_1(BridgeObj,index);</P>
  31. <P>  TRACE("connect return : %d \n", MyFun_1);</P>
  32. <P>  FreeLibrary(HWND_DLL);
  33. </P>

请大家帮助看看,调用失败啊!!!程序哪里有问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

10

主题

32

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部