Bug #4263
closed`pack': can't convert Fixnum into String (TypeError)
Description
=begin
I get the following error:
C:/Ruby192/lib/ruby/1.9.1/Win32API.rb:22:in pack': can't convert Fixnum into String (TypeError) from C:/Ruby192/lib/ruby/1.9.1/Win32API.rb:22:in
block in call'
from C:/Ruby192/lib/ruby/1.9.1/Win32API.rb:21:in each' from C:/Ruby192/lib/ruby/1.9.1/Win32API.rb:21:in
each_with_index'
from C:/Ruby192/lib/ruby/1.9.1/Win32API.rb:21:in call' from C:/Documents and Settings/samuel.treweeks/Desktop/lib/wintir.rb:73:in
object_exists'
from C:/Documents and Settings/samuel.treweeks/Desktop/lib/wintir.rb:616:in initialize' from C:/Documents and Settings/samuel.treweeks/Desktop/lib/wintir.rb:147:in
new'
from C:/Documents and Settings/samuel.treweeks/Desktop/lib/wintir.rb:147:in button' from close_msgbox.rb:6:in
'
0
Exit code: 1
- Create folder structure:
main\lib - In lib put the attached file 'wintir.rb' file in
- In Main puts the attached file 'close_msgbox.rb' in
- Execute close_msgbox.rb
- Error appears in Win32API
Note:
This does not occur in Ruby 1.86
The code is trying to close a msgbox opened from a IE
=end
Files
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Open to Rejected
=begin
You use the result of FindWindowX as the first argument at next call,
but the returned value and the first argument don't match.
FindWindowEx = Win32API.new('user32', 'FindWindowEx', ['P'] * 4, 'L')
should be:
FindWindowEx = Win32API.new('user32', 'FindWindowEx', 'LPPP', 'L')
=end