problems with WlanConnect()

Discussion in 'Wireless Networking' started by Victor.Morozko@gmail.com, May 19, 2008.

  1. Guest

    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...
     
    , May 19, 2008
    #1
    1. Advertising

  2. Pavel A. Guest

    Try to set connectionParameters.strProfile = NULL (not a empty string).

    --PA


    <> wrote in message
    news:...
    > 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...
     
    Pavel A., May 19, 2008
    #2
    1. Advertising

  3. Guest

    NULL changed nothing...
     
    , May 21, 2008
    #3
  4. Pavel A. Guest

    <> wrote in message
    news:...
    > NULL changed nothing...


    XP or Vista?
     
    Pavel A., May 21, 2008
    #4
  5. Guest

    > XP or Vista?

    Sorry. Vista 32 bit (home ultimate).
     
    , May 22, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bigal

    Problems with PHP again...

    bigal, Aug 24, 2005, in forum: The Lounge
    Replies:
    0
    Views:
    1,452
    bigal
    Aug 24, 2005
  2. RObErT_RaTh

    Initial problems registering

    RObErT_RaTh, Aug 24, 2005, in forum: The Lounge
    Replies:
    5
    Views:
    1,578
    unholy
    Aug 26, 2005
  3. Harold Potter

    Re: sound problems and modem problems

    Harold Potter, Dec 3, 2003, in forum: Computer Support
    Replies:
    5
    Views:
    776
    Patrick
    Dec 4, 2003
  4. dominolog

    Native WIFI SDK - Windows XP SP2 - WlanConnect problem

    dominolog, May 8, 2007, in forum: Wireless Networking
    Replies:
    2
    Views:
    3,080
    Yi Lu [MSFT]
    May 10, 2007
  5. hari

    WlanConnect not working

    hari, May 1, 2009, in forum: Wireless Networking
    Replies:
    1
    Views:
    2,097
    Jack [MVP-Networking]
    May 2, 2009
Loading...

Share This Page