Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Ruby 1.9.0 problem with DL.dlopen
Chauk-Mean P.
1/10/2008 9:33:00 AM
Hi,
The following code runs with ruby 1.8.6 (2007-09-24 patchlevel 111)
[i386-mswin32] on Windows :
require 'dl'
user32 = DL.dlopen('user32')
msgbox = user32['MessageBoxA', 'ILSSI']
msgbox.call(0, "Hello", "Message Box", 0)
A message box is displayed with just the OK button.
If I run the same code with ruby 1.9.0 (2007-12-25 revision 14709)
[i386-mswin32], the following error is output :
win_msgbox.rb:3:in `[]': wrong number of arguments(2 for 1)
(ArgumentError)
from win_msgbox.rb:3:in `<main>'
If I just remove the 'ILSSI' argument, this does not work either.
Thanks for any help.
Chauk-Mean.
--
Posted via
http://www.ruby-...
.
1 Answer
Chauk-Mean P.
1/18/2008 3:11:00 PM
0
In case it would be useful for someone else, I received the following
answer from the development team :
--------------
Date: 18/01/2008 07:47
Expéditeur: Usaku Nakamura
Not a bug.
Date: 18/01/2008 07:47
Expéditeur: Usaku Nakamura
1.9's dl is not compatible with 1.8's.
The following code may help you:
require 'dl'
user32 = DL.dlopen('user32')
msgbox = DL::CFunc.new(user32['MessageBoxA'], DL::TYPE_LONG,
'MessageBox')
msgbox.call([0, "Hello", "Message Box",
0].pack('L!ppL!').unpack('L!*'))
---------------
Chauk-Mean.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Ruby 1.9.0 problem with DL.dlopen
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password