From: Bruno Le hyaric Date: 2009-06-13T00:05:24+09:00 Subject: Re: WIN32OLE type binding Gregory Brown wrote: > On Fri, Jun 12, 2009 at 9:00 AM, Bruno Le > hyaric wrote: >> Hi, >> >> My COM Web Browser is making progress... >> I can scan COM API, get and set properties value. >> >> The next step is to permit RPC on methods. > > Can you clarify your question a little bit? I'm not sure whether > you're asking how to call methods on an WIN32OLE object that are > provided by a DLL, or if you're looking for introspection that will > provide a methods signature... > > -greg Ok, I have a graphic interface from wich I want to call COM methods. By introspection I know the signature of methods. The problem is that my interface (a web page) only permits text input. So all values I enter are Strings. I need to cast or interpret strings to match parameters types... I solve the problem for put properties like that : # obj : COM object # prop : name of the property # value : string value I want to put def cast_from_string(obj,prop,value) #call the get property, only to know the type of the Ruby object type = obj.send prop.to_sym #match on Ruby types and convert the string accordingly... case type when Integer return value.to_i when Float return value.to_f when TrueClass, FalseClass return value == true.to_s else return value end end So I want to convert String to the matching Ruby type To do that, I need to have a list of COM types and their matched Ruby types. I wonder if there is that information somewhere in WIN32OLE... I take a screenshot of the web page so you can have an better idea on what I'm trying to do :) Attachments: http://www.ruby-forum.com/attachment/3813/screen.JPG -- Posted via http://www.ruby-forum.com/.