in reply to Re: Win32::Clipboard and Unicode
in thread Win32::Clipboard and Unicode

Well, I found the module on CPAN. I thought the stuff that comes with Perl wasn't also on CPAN, but I guess that doesn't extend to platform-specific modules.

The code is basically:

HANDLE myhandle = GetClipboardData(CF_TEXT); XST_mPV(0, (char *) myhandle);
It seems that the assumption that the HANDLE is equal to the memory pointer is documented when the block is of type GMEM_FIXED. However, SetClipboardData documents that the HANDLE must be allocated with the GMEM_MOVEABLE flag!

Anyway, the function XST_mPV will copy a string (I presume nul-terminated single byte sequence) to the proper place. What's the equivilent function that takes a length, that I can call after I figure out the proper length of the data? the perlapi document that shows this macro doesn't have a similar one that takes a byte array or buffer or whatnot.

—John