有人用过笙泉的MA101桥接器吗?
时间:10-02
整理:3721RD
点击:
- HINSTANCE HWND_DLL;
- 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;
- MW_BridgeMini BridgeObj;
- CString m_strVid;
- CString m_strPid;
- DWORD dwResult = 0;
- DWORD index = 1;
- typedef DWORD (*MyFun)(MW_BridgeMini ,DWORD);
- MyFun MyFun_1;
- m_strVid = "0E6A";
- m_strPid = "0103";
- HWND_DLL = LoadLibrary("BridgeMini.dll");
- BridgeObj.VID = HexStrToDW(m_strVid); //字符串转换为整型
- BridgeObj.PID = HexStrToDW(m_strPid); //字符串转换为整型
- BridgeObj.ReadTimeOut = 0xfffffff; // for demo purpose 默认
- BridgeObj.WriteTimeOut = 0xfffffff;// for demo purpose 默认
- BridgeObj.Handle = HWND_DLL;
- MyFun_1 = (MyFun)GetProcAddress(HWND_DLL,"MA101_ConnectBridge");
- dwResult = MyFun_1(BridgeObj,index);
- TRACE("connect return : %d \n", dwResult);
- FreeLibrary(HWND_DLL);
LZ这里下载MA101_DK_v1.03.zip 开发包 http://www.megawin.com.tw/zh-tw/support/index