--- In [email protected], "Sheri" <sheri...@...> wrote:
> I'm getting 0 for false and -1 for true for BOOL returns. Is that the issue > you mentioned previous re Excel? Can you convert it before returning it? > Boolean parameters are already using 0 and 1 (at least the optional VARIANT > ones like igoreUpperCase in the following script). COM defines true as -1, so you're getting the "right" answer back. Pain in the ass, as of course that can cause all kinds of compatabity problems with other languages (e.g. C). I can convert -1 to 1 for results coming back, but I gotta think about values going out. Problem with optional VARIANTs is I can't assume a 1 must be a BOOL, it might be destined for something that wants an INT. Ugly. I'll note in docs that where a boolean true is expected you're best to provide a -1. > Also, if there is a typespec in effect, and you get an invoke with one or > more parameters (but fewer than the expected number per the typespec) maybe > you could give an error message such as "Invoke parameter count mismatch" > instead of "Programing error, bozo makeVarParam: m_vtParamType should be > VT_EMPTY" :) Sorry, I'll change the error message: should read "Alam made a programing error, the bozo...". Something's not right in my code, not yours. Or maybe both. Thanks for script, will work through it later.
