in reply to Re^2: Print Buffer
in thread Print Buffer

When the function returns, this value contains the address of an allocated buffer, containing the information. I defined my buffer like this...

Does this function have a name and a return type? :--)

In general: sometimes you get back the true length of the buffer $lpBuffer which you can use to decode the actual value. Sometimes $lpBuffer contains a \0, the C string terminator/delimiter so you have to trim the value.

Replies are listed 'Best First'.
Re^4: Print Buffer
by iea (Beadle) on Aug 11, 2008 at 16:01 UTC
    In C its handled with

    PtrToStringUni

    Is there anything like PtrToStringUni in Perl

    Here the C code
    iReturn = Api.GetInformation(hWIM,ref XMLInfo, ref iLength); String XMLStr = Marshal.PtrToStringUni(XMLInfo);