Subject:
Re: [ruby-ffi] Using Windows Unicode functions
From:
Luis Lavena
Date:
1/20/10 8:48 AM
To:
ruby-ffi@googlegroups.com

On Tue, Jan 19, 2010 at 10:08 AM, Quintus <sutniuq@gmx.net> wrote:
>
> Hi there,
>
> I'm trying to access Windows functions through the ffi gem, but I
> wasn't that successfull (otherwise I wouldn't post here, I
> think  ;-)  ). So far, I've been using the win32-api gem which worked
> quite well with the Windows Unicode functions (they require UTF-16LE
> encoded strings, also known as the wchar_t C type I think), but I
> wasn't able to construct that with ffi.
>

MessageBoxW differs from MessageBoxA

MessageBoxA takes LPCCSTR (Ruby equivalent of :string type)
MessageBoxW takes LPCWSTR, which is not defined at this time.

I'm looking over libffi on how to handle LPCWSTR, as it should be
defined as :wstring (wide string), similar to wchar (the wide version
of char)

Will followup with findings.
-- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exupéry