Win32API GetCurrentThreadID

On Windows 2000 server:

$ irb
irb(main):001:0> require 'Win32API'
=> false
irb(main):002:0> thread_id = Win32API.new('kernel32.dll',
'GetCurrentThreadID', [], "L")
RuntimeError: GetProcAddress: GetCurrentThreadID or GetCurrentThreadIDA

        from (irb):2:in `initialize'
        from (irb):2:in `new'
        from (irb):2

This happens both with the cygwin and the one-click installer of Ruby.
Trying to get GetCurrentThreadIDA gives the same result.

Am I doing something wrong?

Guillaume.

Hello.

irb(main):002:0> thread_id = Win32API.new('kernel32.dll',
'GetCurrentThreadID', , "L")

Last 'D' should be lower case. Try 'GetCurrentThreadId'.

# Yes, this is quite confusing because 'GetSystemDefaultLangID' exists.

Douh!

Thanks, that works.

Guillaume.

···

On Thu, 2004-09-09 at 20:13, H.Yamamoto wrote:

Hello.

>irb(main):002:0> thread_id = Win32API.new('kernel32.dll',
>'GetCurrentThreadID', , "L")

Last 'D' should be lower case. Try 'GetCurrentThreadId'.

# Yes, this is quite confusing because 'GetSystemDefaultLangID' exists.