阅读:1913回复:3
请教wifi连接AP的问题
SetNetworkMode(pAdapter , &nNetworkMode); \\设置为Ndis802_11Infrastructure
SetAuthMode(pAdapter , &nAuthMode); \\设置为Ndis802_11AuthModeOpen SetWepMode(pAdapter , &nWepMode); \\设置为Ndis802_11WEPDisabled \\前三个设置都通过,到了设置SSID的时候,过程如下,参考了网上很多例程,很多都是这么写,可在这就是不成功,GetError得到Error87 SetSSID(pAdapter ,szSSID) HRESULT WLan::SetSSID(LPWSTR pAdapter , char * szSSID) { UCHAR SetBuffer[sizeof(NDISUIO_SET_OID) + sizeof(NDIS_802_11_SSID)]; PNDISUIO_SET_OID pSetOid; HRESULT hRes = E_HANDLE; DWORD dwBytesReturned; NDIS_802_11_SSID ssid; if (szSSID == NULL) { hRes = E_POINTER; } else { pSetOid = (PNDISUIO_SET_OID) &SetBuffer[0]; pSetOid->ptcDeviceName = pAdapter;//m_DeviceName; pSetOid->Oid = OID_802_11_SSID; memset(&ssid , 0 , sizeof(ssid)); ssid.SsidLength = strlen(szSSID); memcpy((char*)ssid.Ssid , szSSID , ssid.SsidLength); memcpy(&pSetOid->Data[0], &ssid, sizeof(NDIS_802_11_SSID)); if (!DeviceIoControl(m_handle, IOCTL_NDISUIO_SET_OID_VALUE, (LPVOID) &SetBuffer[0], sizeof(SetBuffer), (LPVOID) &SetBuffer[0], 0, &dwBytesReturned, NULL)) { hRes = E_FAIL; } } return hRes; } wince里面原本就有一个扫描连接的程序,可我们要把这个做在自己的UI里面,请帮忙看看怎么回事不甚感激 |
|
沙发#
发布于:2008-12-01 08:40
怎么没有人回答啊,自己顶一下了,达人快来
|
|
板凳#
发布于:2008-12-04 11:11
没有人知道吗?
|
|
地板#
发布于:2008-12-05 11:09
怎么还是没有人来指点一下啊!高手在哪里?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
|
|