Re: External API (COM) needs bstring
- From: Jens <tcl070219@xxxxxxxxxxx>
- Date: Mon, 26 Feb 2007 14:11:38 +0100
Thank you,
but it does not work. We found the following solution:
we made a wrapper around the dll with C++ and the functions in the wrapper dll work together with the tcom-package from tcl.
palmtcl@xxxxxxxxx schrieb:
AFAIK, when type information for an interface is not available, tcom.
makes a best guess based on what the current internal Tcl_Obj type for
the data being passed. This may not always be correct. I've run into
this when the API expected an int but tcom was passing a BSTR because
the Tcl_Obj was a string object. To coerce it to be passed as an int
you had to do something like passing [expr {$var+0}] so the result of
expr would internally be an integer object and be passed as an VT_INT.
In your case, you have the opposite problem I think. Are you passing a
value that is an integer or float, possibly a result of a calculation?
You would need to force Tcl to convert this to a string internally.
I'm not sure exactly how you would do this, but assuming $var holds
the param value to be passed, you could try passing [string range $var
0 end] to the tcom call or perhaps do a
append var ""
and pass $var to the tcom call.
Try that, no guarantees.
/Ashok
On Feb 19, 3:51 pm, Jens <tcl070...@xxxxxxxxxxx> wrote:That´s correct, I mean the BSTR Type. We use the tcom package that
worked with excel and word very good in different projects.
When we try to call the API function with a string (in the documentation
I read the type is BSTR) we get the following message:
0x80020005 {Type mismatch}
- References:
- External API (COM) needs bstring
- From: Jens
- Re: External API (COM) needs bstring
- From: palmtcl
- Re: External API (COM) needs bstring
- From: Jens
- Re: External API (COM) needs bstring
- From: palmtcl
- External API (COM) needs bstring
- Prev by Date: Re: GPL contamination with ffidl?
- Next by Date: Re: GPL contamination with ffidl?
- Previous by thread: Re: External API (COM) needs bstring
- Next by thread: Chage text on file open/save dialog boxes.
- Index(es):
Relevant Pages
|