[Win32utils-devel] win32-api idea - wide method first based on $KCODE
waynev at gmail.com
Tue Nov 13 20:45:22 EST 2007
I'm hardly an expert on any of this, but what you propose makes sense to me.
On Nov 13, 2007 1:11 PM, Berger, Daniel <Daniel.Berger at qwest.com> wrote:
> Currently, the Win32::API.new method will search for the function name,
> then the 'A' (ANSI) name, and finally the 'W' (Wide) name. The code
> looks something like this:
> fProc = GetProcAddress(hLibrary, TEXT(RSTRING(v_proc)->ptr));
> VALUE v_ascii = rb_str_new3(v_proc);
> v_ascii = rb_str_cat(v_ascii, "A", 1);
> fProc = GetProcAddress(hLibrary, TEXT(RSTRING(v_ascii)->ptr));
> VALUE v_unicode = rb_str_new3(v_proc);
> v_unicode = rb_str_cat(v_unicode, "W", 1);
> fProc = GetProcAddress(hLibrary, TEXT(RSTRING(v_unicode)->ptr));
> So, for example, when you do this:
> It looks for SomeFunc. If that fails it looks for SomeFuncA (which is
> what most of the functions actually default to). If that fails it looks
> for SomeFuncW. If that fails, then an error is raised.
> What about switching the order so that it looks for SomeFuncW -first-
> and SomeFuncA -second- if $KCODE = u? Does that seem reasonable?
> This communication is the property of Qwest and may contain confidential
> privileged information. Unauthorized use of this communication is strictly
> prohibited and may be unlawful. If you have received this communication
> in error, please immediately notify the sender by reply e-mail and destroy
> all copies of the communication and any attachments.
> win32utils-devel mailing list
> win32utils-devel at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the win32utils-devel