1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/win32ole/err_in_callback.rb
suke 2d45869c76 * ext/win32ole/win32ole.c (ole_event_free): invoke IConnectionPoint::Unadvise
before invoking IConnectionPoint::Release.

* test/win32ole/test_win32ole_event.rb, test/win32ole/err_in_callback.rb,
  test/win32ole/test_err_in_callback.rb: Use ActiveX Data Object
  Library instead of InternetExplorer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-02 13:22:42 +00:00

9 lines
249 B
Ruby

require 'win32ole'
db = WIN32OLE.new('ADODB.Connection')
db.connectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;"
ev = WIN32OLE_EVENT.new(db)
ev.on_event('WillConnect') {|*args|
foo
}
db.open
WIN32OLE_EVENT.message_loop