- <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>
请大家帮助看看,调用失败啊!!!程序哪里有问题
|