- 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
", dwResult);
- FreeLibrary(HWND_DLL);
复制代码上述源码哪里出问题了,请大家指正。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>