On 1/16/07, Tim Uckun <timuckun / gmail.com> wrote:
> Hello All.
>
> I want to translate the following VB code to Ruby. Does anybody know
> how to handle these events?
>
> Dim WithEvents myOBJ As SomeOBJ
>
> Private Sub myOBJ_SomeEvent(ByVal nCommand As Integer,
>                                   ByRef cResult As String)
>
> ---
> Also things like this...
>
> Event SomeFunction(ByVal n as Integer)
>
> SomeFunction(5)

If you want to receive COM events,
see WIN32OLE library, class WIN32OLE_EVENT,
Programming Ruby, chapter on windows support,
thread
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/98e22146a1c503e7/37b07544198f5bf1%2337b07544198f5bf1
http://groups.google.com/group/ruby-talk-google/browse_frm/thread/1dc66ac34191f20c/3e16fc7ea887a00a%233e16fc7ea887a00a
and my doc patch
http://rubyforge.org/tracker/?func=detail&aid=7557&group_id=426&atid=1700

If you want to rewrite the code without interacting with COM, it's
another story.
In that case, write in more detail what are you trieng to achieve.