Hi, I need to do the functional equivalent of a QueryInterface. I have an object but I need access to methods in another interface that it supports. How can I do that? Thanks! ________________________________ Carey Nation <mailto:firstname.lastname@example.org> Software Engineer Turner Broadcasting System, Inc Internet Technologies (404)827-2935 (wk) (404)824-0033 (cell)
on 2007-02-07 21:18
on 2007-02-07 23:17
On 2/7/07, Nation, Carey <Carey.Nation@turner.com> wrote: > Hi, > > I need to do the functional equivalent of a QueryInterface. I have an > object but I need access to methods in another interface that it > supports. How can I do that? AFAIK, Win32OLE can't do that (at least in Ruby 1.8 branch). There's a patch pending in the tracker (http://rubyforge.org/tracker/?func=detail&atid=170...) that you can apply to sources and compile yourself, if you don't want to wait for it to be applied. In that case, please report any problems back to the tracker. You'll find more details in the patch comments (Masaki Suketa is the maintainer of WIN32OLE).
on 2007-02-08 16:24
Ah, ok, thanks. Guess I'm a little dense. I couldn't find anything about how to apply the patch. Can you point me at something? Thanks!
on 2007-02-08 23:21
On 2/8/07, Nation, Carey <Carey.Nation@turner.com> wrote: > Ah, ok, thanks. Guess I'm a little dense. I couldn't find anything > about how to apply the patch. Can you point me at something? > > Thanks! So, here we go: You'll need: 1. ruby-oneclick installed 2. msvc6 installed 3. the patch from the tracker 4. (optionally) the patch program This is how to proceed: 1. copy the patch where the sources of win32ole are (c:/ruby/src/ruby-1.8.xxx/ext/win32ole 2. patch the source: 2.a (if you have the patch program): patch -p2 < ruby-1.8-changes.patch 2.b otherwise: just copy the + lines into appropriate place (you have a bit of context, and line numbers to find the place) 3. start a console (cmd) 4. run vcvars32.bat from ms vc bin dir (I don't know the exact place, look it up. It might be named a bit different though). This will setup the compile environment. 5. run from the win32ole directory extconf.rb That should check available libs and headers, and prepare a Makefile. 6. now start the compilation: nmake 7. if everything went ok, you'll have a brand new win32ole.so. Copy it to c:/ruby/lib/1.8/i386-mswin32/ and you're done. Notes: - It should be possible to use mingw gcc compiler, but I don't know how. - You should rather try the compilation with unpatched file, e. g. do this once without step 2. to see if you're able to compile. - There might be an easier way to do all of this, but you have to ask wiser men ;-) Basically, you need to google for two things: 1. how to compile a ruby extension and 2. how to patch a file - Beware that the patch is untested, so it may (the author says so) or may not work.