--- In [email protected], "Sheri" <sheri...@...> wrote:
>
> Previously discussed Search function with four arguments, each of type 
> "Variant" (because they are optional):
> 
> local r=myselect.Search(chgVec[i,1], wholeword, casesensitive, chgVec[i,2])
 
> The four arguments if present should be string, boolean, boolean, string (but 
> you don't know that).
> 
> Sometimes one of the string arguments happens to composed of all digits.
> 
> When processed as ANSI, I get
> 
> ERROR: com.method: Invoke failed  (sys code 80020009: "Exception occurred.")
 
> But when processed as Unicode, it works (only tried it with unicode for the 
> two string arguments).

Would that be all the time, or only when the string in question is all digits?

If the former, weird, because if (a) argument is a VARIANT AND (b) 
string providied is not apparently a real or integer, it's sent in as a BSTR, 
i.e. a wide string.
 
> For ANSI variation, it works only if I use method_typed.
> 
> No way to tell the variant type to be amenable to whatever the app ultimately 
> wants?

Nope, that's what VARIANT means.  It's recipient's responsibility to provide 
translation of whatever actual type comes in to the type it wants.




Reply via email to