Win32API GetCurrentThreadID

  • Thread starter Guillaume Marcais
  • Start date
G

Guillaume Marcais

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.
 
H

H.Yamamoto

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.
 
G

Guillaume Marcais

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

A Win32API question 4
Something I expected to work, but didn't! 10
parentheses and newlines 2
Socket hang in thread 1
cannot load watir 7
convert date 5
Digest::Base problem 22
require command problem 4

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top