From: Victor.Morozko on
Greetings...

I'm trying automatically connect to my wireless network.
I'm using such:

std::auto_ptr<DOT11_SSID> dot11SSID(new DOT11_SSID);
dot11SSID->uSSIDLength = ssid.size();
::memcpy(dot11SSID->ucSSID, ssid.c_str(), ssid.size());

WLAN_CONNECTION_PARAMETERS connectionParameters;
connectionParameters.wlanConnectionMode = wlan_connection_mode_auto;
connectionParameters.strProfile = L"";
connectionParameters.pDot11Ssid = dot11SSID.get();
connectionParameters.pDesiredBssidList = NULL;
connectionParameters.dot11BssType = dot11_BSS_type_any;
connectionParameters.dwFlags = WLAN_CONNECTION_HIDDEN_NETWORK;

result = ::WlanConnect(clientHandle, &wlanInterfaceGuid,
&connectionParameters, NULL);

code. (ssid -- std::string) But result always ==
ERROR_INVALID_PARAMETER

What I'm doing wrong?

Best regards...
From: Pavel A. on
Try to set connectionParameters.strProfile = NULL (not a empty string).

--PA


<Victor.Morozko(a)gmail.com> wrote in message
news:59ae27e8-8ca1-4695-b27c-3b5c5b622bdf(a)d1g2000hsg.googlegroups.com...
> Greetings...
>
> I'm trying automatically connect to my wireless network.
> I'm using such:
>
> std::auto_ptr<DOT11_SSID> dot11SSID(new DOT11_SSID);
> dot11SSID->uSSIDLength = ssid.size();
> ::memcpy(dot11SSID->ucSSID, ssid.c_str(), ssid.size());
>
> WLAN_CONNECTION_PARAMETERS connectionParameters;
> connectionParameters.wlanConnectionMode = wlan_connection_mode_auto;
> connectionParameters.strProfile = L"";
> connectionParameters.pDot11Ssid = dot11SSID.get();
> connectionParameters.pDesiredBssidList = NULL;
> connectionParameters.dot11BssType = dot11_BSS_type_any;
> connectionParameters.dwFlags = WLAN_CONNECTION_HIDDEN_NETWORK;
>
> result = ::WlanConnect(clientHandle, &wlanInterfaceGuid,
> &connectionParameters, NULL);
>
> code. (ssid -- std::string) But result always ==
> ERROR_INVALID_PARAMETER
>
> What I'm doing wrong?
>
> Best regards...

From: Victor.Morozko on
NULL changed nothing...
From: Pavel A. on
<Victor.Morozko(a)gmail.com> wrote in message
news:0427e122-ac49-4846-9f14-41d33d6c5f0f(a)t54g2000hsg.googlegroups.com...
> NULL changed nothing...

XP or Vista?



From: Victor.Morozko on
> XP or Vista?

Sorry. Vista 32 bit (home ultimate).