Syver Enstad <
[hidden email]> writes:
I've hacked in generation of do: methods for Automation collections in
AXInterfaceTypeAnalyzer.
do: aBlock
| index |
index := 1.
[index <= self count] whileTrue: [
aBlock value: (self item: index). index := index + 1]
For some COM objects I had to insert a runtime test at the top of the method:
self isVBCollection ifFalse: [^nil].
This was because we don't know if they are collection at compile
time. The ifFalse: part should probably raise an exception
instead. Does anybody know of a suitable exception to throw if we find
out at runtime that an object actually doesn't support enumeration but
the client has called the method anyway?
Btw, Dolphin must be one of the best way of getting to know a COM
object. It's extremely nice to be able to call a method on a COM
object and then just browse the class of the return value from the
method. Great stuff!
--
Vennlig hilsen
Syver Enstad