ajose has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I am just beginner in using the Perl module Win32::API. I could successfully invoke the Win32 API's and parse the return values using this module. But now I am stuck at a point where I have to invoke the API with a parameter of data type LPCWSTR as an input parameter. I tried following method to achieve the same.
$profileName = encode("UTF-16LE", $profileName); $profileName = pack ('p', $profileName); $API{ api}->Call($handle, $interface, $profileName, 0, $profileXml +, 0, 0));
API declaration:
DWORD WINAPI WlanGetProfile( __in HANDLE hClientHandle, __in const GUID *pInterfaceGuid, __in LPCWSTR strProfileName, __reserved PVOID pReserved, __out LPWSTR *pstrProfileXml, __inout_opt DWORD *pdwFlags, __out_opt PDWORD pdwGrantedAccess );
Output is:
Argument "t\0e\0s\0t\0\0\0\0\0\0\0\0\0\0\0\0\0..." isn't numeric in su +broutine entry at ...
Please help me by suggesting any work around to convert the string to LPCWSTR format before invoking the API. Also output of this API call is also a pointer type(LPWSTR). Hence please help me here also.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::API : Creating a LPCWSTR type input parameter from a string
by ikegami (Patriarch) on Aug 23, 2011 at 20:11 UTC | |
by ajose (Acolyte) on Aug 24, 2011 at 10:06 UTC | |
|
Re: Win32::API : Creating a LPCWSTR type input parameter from a string
by AllBackJack (Initiate) on Jul 17, 2012 at 23:30 UTC | |
|
Re: Win32::API : Creating a LPCWSTR type input parameter from a string
by locked_user sundialsvc4 (Abbot) on Aug 24, 2011 at 12:39 UTC | |
by ajose (Acolyte) on Aug 25, 2011 at 16:25 UTC |