[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...

Issue #14357 has been reported by vo.x (Vit Ondruch).

11 messages 2018/01/15
[#85364] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults — Eric Wong <normalperson@...> 2018/02/03

v.ondruch@tiscali.cz wrote:

[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...

Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).

10 messages 2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...> 2018/01/23

hsbt@ruby-lang.org wrote:

[ruby-core:84809] [Ruby trunk Feature#14348] win32ole: enable using a bit weirder classes than usual

From: wolf@...
Date: 2018-01-10 11:34:50 UTC
List: ruby-core #84809
Issue #14348 has been reported by graywolf (Gray Wolf).

----------------------------------------
Feature #14348: win32ole: enable using a bit weirder classes than usual
https://bugs.ruby-lang.org/issues/14348

* Author: graywolf (Gray Wolf)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Currently win32ole requires coclass to directly implement (one) IDispatch. That
works fine for

```
coclass Good {
	[default] interface GoodIface2;
	interface GoodIface1;
};

interface GoodIface1 : IDispatch {
	// snip
};

interface GoodIface2 : GoodIface1 {
	// snip
};
```

however, it fails to work for the following

```
coclass Bad {
	[default] interface BadIface1;
	interface BadIface2;
};

interface BadIface1 : IDispatch {
	// snip
};

interface BadIface2 : IDispatch {
	// snip
};
```

I suspect it's because when you ask for `IDispatch` of `Bad`, it doesn't know
which one to give you (but I'm no COM expert so correct me if I'm wrong).

Now, please let's not discuss if classes like that are good idea or not (I
think they are not), fact is they do exists and simple patch allows using them
with ruby's win32ole.

Attached patch adds new `iface` keyword argument which let's you pick interface
to acquire (it must still implement `IDispatch`). Documentation also says that
you *very* likely do *NOT* need to use this argument.

Usage in my particular case would look like this:

```
LIBNAME = 'xxx'
TYPELIB = WIN32OLE_TYPELIB.new(LIBNAME)

lic = 'xxxx'

foo = WIN32OLE.new(
  TYPELIB.ole_type.find { |t| t.name == 'Foo' },
  nil,
  license: lic,
  iface: '{00000000-0000-0000-0000-000000000000}'
)

foo.Bar(1, 2, 'foobar')
```

as you can see, except for the need to specify the interface, it works exactly
same as normal classes.

Please consider for merge `^_^`


---Files--------------------------------
0001-win32ole-Enable-COM-classes-with-multiple-IDispatch.patch (4.38 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next