Subject: Re: Problem accessing a method through TCOM v1.8 - DN [1]
plambert@daasolutions.com (Paul R. Lambert) - 11 Oct 1999 - comp.lang.tcl
I got my answer from another source.
I was doing the following:
set l1 {}
set result [$gIntentAPI RefMethod "Root:TestMethod:" "default" $l1]
I passed an empty Tcl string as the third argument which is of
type VARIANT. Tcom converted the Tcl string to a BSTR. The object
implementing the RefMethod method expected the VARIANT to hold
another data type and returned result code E_FAIL (0x80004005).
Tcom converts a Tcl list to an array of VARIANT. Use the list command
to create a Tcl list. The following worked:
set l1 [list a b c]
set result [$gIntentAPI RefMethod "Root:TestMethod:" "default" $l1]
Also, if, using the same method, I refer to a method that demands and
empty list for the third argument, the following doesn't work:
set l1 [list ]
set result [$gIntentAPI RefMethod "Root:TestMethod:" "default" $l1]
BUT the following DOES work:
set l2 [list ]
llength $l2 (returns a length of 0)
set result [$gIntentAPI RefMethod "Root:TestMethod:" "default" $l2]
I was told that the reason the second method worked was because using
the list command with no arguments results in an empty string so a
list was not created. Using the llength function converted l2 into a
list.
On Sun, 10 Oct 1999 23:09:57 +0100, Robin Becker
<robin@jessikat.demon.co.uk> wrote:
>In article <3800d7f2.9511745@news.erols.com>, Paul R. Lambert
><plambert@daasolutions.com> writes
>>I'm not sure I understand. If you mean 'by ref' in the VB sense where
>>the data passed into the method call is sent using the keyword
>>'BYREF', the answer would be yes. The array being 'ref' must be an
>>array of variants in VB.
>>
>...
>have you got byref arguments working with other methods? I ask only
>because it's difficult for TCL to do the right thing for byref type
>arguments. I had some trouble with tcom and byref things.
>--
>Robin Becker
Last modified
1999-10-19
1999-10-19
(195.108.246.51)
Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated
