--- In [email protected], "entropyreduction" 
<alancampbelllists+ya...@...> wrote:
> 
> --- In [email protected], "Sheri" <sherip99@> wrote:
> 
> > Glad to hear that IErrorInfo might be useful. In case you missed this info 
> > relevant to skipping parameters (ala your type t):
>  
> > A skipped optional parameter is a variant of type VT_ERROR with
> > an .scode field value of DISP_E_PARAMNOTFOUND
> > <http://support.microsoft.com/kb/238981>
> 
> Yeah, got that, ta.
> 
> Try comPlugin0.72_100111.zip in
> http://tech.groups.yahoo.com/group/power-pro/files/0_TEMP_/AlansPluginProvisional/
> 
> My intention with set_arg_types was that "t" would mark an absent
> parameter: so like this:
> 
> com.set_arg_types("s t t s ")
> objApp.GetSaveAsFileName("TestVariants.xls", "Hello")
> 
> not this
> objApp.GetSaveAsFileName("TestVariants.xls", "", "", "Hello")

That doesn't seem sensible, would prefer the content of any provided arguments 
meant to be skipped just be discarded.

> 
> But anyway doesn't work yet. Among other things I should be
> picking up any default value available via FUNCDESC, or at least
> I think I should.

I don't think that should be necessary. If the argument is left off from the 
end the defaults are automatically applied and my understanding is that the 
same thing should happen if the argument is properly skipped (with via a 
special error variant).

> 
> Does comPlugin0.72_100111.zip take care of problems with your
> Search method?

No.

FYI: chgVec[0,1]=123 and chgVec[0,2]=abc

r=myselect.Search(chgVec[i,1], wholeword, casesensitive, chgVec[i,2])
--------------------------
ANSI arguments, no set_arg_types:

comPlugin0.72_100107:
ERRORS: com.method: Invoke failed  (sys code 80020009: "Exception occurred.")
comPlugin0.72_100108
ERROR: com.method: Invoke failed (sys code 80020008: "Bad variable type.")
comPlugin0.72_100111
ERRORS: com.method: Invoke failed  (sys code 80020009: "Exception occurred.")
---------------------------
ANSI arguments, using set_arg_types:

com.set_arg_types("svbvbvsv",1)
r=myselect.Search(chgVec[i,1], wholeword, casesensitive, chgVec[i,2])

comPlugin0.72_100107:
success
comPlugin0.72_100108:
success
comPlugin0.72_100111:
success
---------------------------
UNICODE arguments, no set_arg_types:

comPlugin0.72_100107:
success
comPlugin0.72_100108:
success
comPlugin0.72_100111:
success
---------------------------
UNICODE arguments, using set_arg_types:

comPlugin0.72_100107:
success
comPlugin0.72_100108:
success
comPlugin0.72_100111:
success

Haven't tried anything yet with Excel errors or skipped arguments with 
comPlugin0.72_100111. Note that the vbscript error message when there was no 
Workbook open when ActiveWorksheet was referenced came directly from the 
runtime, not from Excel.exe. Some internal mechanism may be trapping that no 
Object was returned when one was expected.

> 
> I'm getting oddest behaviour with stuff like
> 
> local objSheet = appRef.ActiveWorkbook.Worksheets(1)
> 
> before a new worksheet is added.
> 
> I'm getting IDispatch::Invoke calls that 
> 
>  -- return HRESULT 0 (not failure)
> 
>  -- for which QueryInterface(IID_ISupportErrorInfo, etc
>     indicates support for ErrorInfo
> 
>  -- but then don't return a valid ErrorInfo* (not too surprising
>     with HRESULT 0)
> 
>  -- but produce a result VARIANT with vt == VT_DISPATCH 
>     but a NULL pdispval.  Very odd.
> 
> comPlugin0.72_100111.zip version dances around all that.
> 
> Getting better error messages...well, I've done the 
> QueryInterface(IID_ISupportErrorInfo/ErrorInfo, but that only
> applies just after an Invoke has vbeen done on an IDispatch. I
> can add a lot more detailed reporting when doing all the
> parameter checking stuff, but that's a lot of work. Not gonna do
> it for now. The dll has grown like topsy since I started doing
> more rigourous param checking/conversion, and a lot of
> error-reporting code would inflate it further. Maybe sometime
> later.

You could also release .72 without enhanced error reporting, and work on that 
in a later release if this doesn't gel quickly.

Regards,
Sheri

Reply via email to