|
windows
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WlanConnect not workingI am trying to use WlanConnect to a connect to a ad-hoc network. I am getting the error invalid parameter. I know the ssid of the ad-hoc network and wanna connect to it using the ssid and not the profile name. It is an unsecure network. I found samples on the net to connect to wifi network using the profile name and tat works for me.. but I want to connect using the SSID... Here is the code WLAN_CONNECTION_PARAMETERS wlanConnPara; // set the connection mode wlanConnPara.wlanConnectionMode = wlan_connection_mode_discovery_unsecure; // set the profile name wlanConnPara.strProfile = NULL; // set the SSID DOT11_SSID Ssid={0}; string strSsid = "harinetwork"; Ssid.uSSIDLength = (ULONG)strSsid.size(); memcpy(&Ssid.ucSSID, strSsid.c_str(), strSsid.size()); wlanConnPara.pDot11Ssid = &Ssid; wlanConnPara.dot11BssType = dot11_BSS_type_independent; // the desired BSSID list is empty wlanConnPara.pDesiredBssidList = NULL; // no connection flags wlanConnPara.dwFlags = 0; if((error = WlanConnect(hClient,&guid,&wlanConnPara,NULL)) == ERROR_SUCCESS) { cout<<"Done"<<endl; } else { cout<<"error "<<error<<endl; } Hi
Knowing the SSID of Ad-Hoc Network does not mean that you can connect to it. There can be other element that are needed to configure, and in some cases that can be a None computer device that you can not connect to at all. Jack (MS, MVP-Networking) Show quoteHide quote "hari" <h***@discussions.microsoft.com> wrote in message news:C722638B-8D5A-4CF6-A366-3959CF8F80A6@microsoft.com... > Hi all, > > I am trying to use WlanConnect to a connect to a ad-hoc network. I am > getting the error invalid parameter. > > I know the ssid of the ad-hoc network and wanna connect to it using the > ssid > and not the profile name. It is an unsecure network. I found samples on > the > net to connect to wifi network using the profile name and tat works for > me.. > but I want to connect using the SSID... > > Here is the code > > WLAN_CONNECTION_PARAMETERS wlanConnPara; > > // set the connection mode > wlanConnPara.wlanConnectionMode = wlan_connection_mode_discovery_unsecure; > > // set the profile name > wlanConnPara.strProfile = NULL; > > // set the SSID > DOT11_SSID Ssid={0}; > string strSsid = "harinetwork"; > Ssid.uSSIDLength = (ULONG)strSsid.size(); > memcpy(&Ssid.ucSSID, strSsid.c_str(), strSsid.size()); > > wlanConnPara.pDot11Ssid = &Ssid; > > wlanConnPara.dot11BssType = dot11_BSS_type_independent; > > // the desired BSSID list is empty > wlanConnPara.pDesiredBssidList = NULL; > > // no connection flags > wlanConnPara.dwFlags = 0; > > if((error = WlanConnect(hClient,&guid,&wlanConnPara,NULL)) == > ERROR_SUCCESS) > { > cout<<"Done"<<endl; > } > else > { > cout<<"error "<<error<<endl; > }
duplicate name on network when switching wireless to wired network
route wan trafic to wireless adapter; lan through wired connecting a laptop to network. Suddenly will not connect to one of my networks Totally wireless network Script Wireless Zero Config on XP? PRINTING TO A REMOTE PRINTER Laptop Adapter File transfer through OBEX protocol Wireless repeater |
|||||||||||||||||||||||