打印
[疑难问答]

请教!PC机连接MA101源码失败。

[复制链接]
1606|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
快乐一个人|  楼主 | 2015-7-16 09:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

} MW_BridgeMini;</P>
<P> </P>
<P> </P>
<P>
  HINSTANCE HWND_DLL;

     MW_BridgeMini BridgeObj;</P>
<P>  CString m_strVid;
  CString m_strPid;</P>
<P>  DWORD dwResult = 0;</P>
<P>  DWORD index = 1;</P>
<P>  typedef int (*MyFun)(MW_BridgeMini,DWORD);
  MyFun MyFun_1;</P>
<P>
  m_strVid = "0E6A";
  m_strPid = "0103";</P>
<P>  HWND_DLL = LoadLibrary("BridgeMini.dll");</P>
<P>  BridgeObj.VID = HexStrToDW(m_strVid); //字符串转换为整型
  BridgeObj.PID = HexStrToDW(m_strPid); //字符串转换为整型
  BridgeObj.ReadTimeOut =  0xfffffff; // for demo purpose  默认
  BridgeObj.WriteTimeOut = 0xfffffff;// for demo purpose   默认</P>
<P>
  MyFun_1 = (MyFun)GetProcAddress(HWND_DLL,"MA101_ConnectBridge");</P>
<P>  dwResult = MyFun_1(BridgeObj,index);</P>
<P>  TRACE("connect return : %d \n", MyFun_1);</P>
<P>  FreeLibrary(HWND_DLL);
</P>

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

本版积分规则

10

主题

32

帖子

1

粉丝