Win32::API::Struct->typedef('WLAN_CONNECTION_PARAMETERS', qw( WLAN_CONNECTION_MODE wlanConnectionMode; LPCWSTR strProfile; PDOT11_SSID pDot11Ssid; PDOT11_BSSID_LIST pDesiredBssidList; DOT11_BSS_TYPE dot11BssType; DWORD dwFlags; )); Win32::API::Struct->typedef ('DOT11_SSID', qw( ULONG uSSIDLength; UCHAR ucSSID; ));
"WLAN_CONNECTION_MODE wlanConnectionMode;", "PDOT11_SSID pDot11Ssid;", "PDOT11_BSSID_LIST pDesiredBssidList;", "DOT11_BSS_TYPE dot11BssType;" as types have never been registered earlier with Win32::API::Struct. Some of those are enums and not pointers to structs, which leads me to the next issue
# unused Win32::API::Struct->typedef('WLAN_CONNECTION_MODE', qw( wlan_connection_mode_profile = 0, wlan_connection_mode_temporary_profile, wlan_connection_mode_discovery_secure, wlan_connection_mode_discovery_unsecure, wlan_connection_mode_auto, wlan_connection_mode_invalid ));
Win32::API::Struct does NOT support enums. On Windows, enum is a "int", which always 32 bits, regardless of platform (32/64).

Win32::API::Struct can do a better job giving error messages when encountering unknown types.

update, your script doesn't run,
C:\Documents and Settings\Owner\Desktop\cpan libs\Win32-Wlan-0.06>perl + wlan.pl Win32::API::Struct::typedef: unknown member type="WLAN_CONNECTION_MODE +", name="w lanConnectionMode" at C:/perl512/site/lib/Win32/API/Struct.pm line 46. Win32::API::Struct::typedef: unknown member type="wlan_connection_mode +_profile", name="=" at C:/perl512/site/lib/Win32/API/Struct.pm line 46. Unknown Win32::API::Struct 'WLAN_CONNECTION_PARAMETERS' at C:/perl512/ +site/lib/W in32/Wlan/API.pm line 373 Can't call method "Pack" on unblessed reference at C:/perl512/site/lib +/Win32/Wla n/API.pm line 381. C:\Documents and Settings\Owner\Desktop\cpan libs\Win32-Wlan-0.06>

In reply to Re^7: Adding WlanConnect() to Win32::Wlan::API (modded Wlan::API.pm) by bulk88
in thread Adding WlanConnect() to Win32::Wlan::API by tomsell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.