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).

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" :)

global com_status, com_type
local AppRef=com.create_object("Excel.Application")
AppRef.Visible=1
local cp=file.folder(win.exepath("c=powerpromain"))++?"\plugins\com.dll"
local d=file.getdate(cp,"m")
win.debug("com.dll version:"++file.version(cp))
win.debug("dated:"++;;+
formatdate("MM/dd/yyyy",d.slice(8))++formattime(" hh:mm tt", ;;+
d.slice(-6)))
local desc=appRef.get_object_description("fdnpt")
for each line myline in desc
  if (index(myline, "checkspelling"))
    win.debug(myline)
endfor
;BOOL CheckSpelling(IN BSTR word, IN VARIANT customDictionary (optional), ;;+
;IN VARIANT ignoreUppercase (optional))
win.debug("note: ignoreUppercase causes checkspelling to ignore words in all 
CAPS")
win.debug("=========== Test 1 no typespec ==============")
com.set_arg_types ;;reset any existing
win.debug?Z""Z++" gets default treatment - no typespec given")
TestSpellFunction(appref)
win.debug("=========== Test 2 \x22\x22 is empty string ==============")
com.set_arg_types("s s b ",1)
win.debug(?Z""Z++" is empty string")
TestSpellFunction(appref)
win.debug("=========== Test 3  \x22\x22 is skipped param ==============")
com.set_arg_types("s t b ",1)
win.debug(?Z""Z++" is skipped parameter")
TestSpellFunction(appref)
com.unload
quit

Function TestSpellFunction(AppRef)
Exec.OnError("none")
win.debug(?ZAppRef.CheckSpelling("HAX","",1)Z++" returns "++ ;;+
AppRef.CheckSpelling("HAX","",1))
win.debug("com_status=",com_status)
win.debug(?ZAppRef.CheckSpelling("HAX","",0)Z++" returns "++ ;;+
AppRef.CheckSpelling("HAX","",0))
win.debug("com_status=",com_status)
win.debug(?ZAppRef.CheckSpelling("hex","",0)Z++" returns "++ ;;+
AppRef.CheckSpelling("hex","",0))
win.debug("must remove typespec or following fails")
win.debug(?ZAppRef.CheckSpelling("hex")Z++" returns "++ ;;+
AppRef.CheckSpelling("hex"))
win.debug("com_status=",com_status)
;same test after removing typespec
com.set_arg_types
win.debug(?ZAppRef.CheckSpelling("hex")Z++" returns "++ ;;+
AppRef.CheckSpelling("hex"))
win.debug("com_status=",com_status)
quit


Reply via email to