I have an Interop''ed COM object (System.__ComObject) that I''m trying to use from an IronRuby script. Because the way that you seem to QueryInterface from .NET is to use casting, I therefore need to cast from within IronRuby. Basically: comobject = Activator.create_instance(base_com_type) # returns a base type which is IUnknown + not much else comobject.do_stuff # throws NoMethodError. In C#, I''d then do ((ICanDoStuff)comObject).do_stuff; which calls QueryInterface, so the do_stuff method will now actually exist. Is there any way I can do this? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090327/acf2e66a/attachment.html>
Does the COM object implement IDispatch? Does the DLR / IronRuby invoke operations against IDispatch automagically? 2009/3/26 Orion Edwards <orion.edwards at gmail.com>> I have an Interop''ed COM object (System.__ComObject) that I''m trying to use > from an IronRuby script. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090326/b7cf7776/attachment.html>
I''m not using IDispatch here. These are all statically generated proxy classes from some custom C++ COM Interfaces. Hopefully if I can get casting to work, I''ll be good to go 2009/3/27 Brannon Jones <brannon at iterator.net>> Does the COM object implement IDispatch? > > Does the DLR / IronRuby invoke operations against IDispatch automagically? > > 2009/3/26 Orion Edwards <orion.edwards at gmail.com> > >> I have an Interop''ed COM object (System.__ComObject) that I''m trying to >> use from an IronRuby script. >> > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090327/4df65465/attachment.html>