Re: sending last variable defined as default from VBS to ATL object
From: Michael Harris \(MVP\) ("Michael)
Date: 10/28/04
- Next message: Michael Harris \(MVP\): "Re: how do I remotely install WMI on w2k3?"
- Previous message: Michael Harris \(MVP\): "Re: VB script skelleton"
- In reply to: Ronen: "sending last variable defined as default from VBS to ATL object"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 27 Oct 2004 17:05:43 -0700
> I had a problem which i try to solve.
>
> It seems that if I define a mthod in idl file the last variable as
> default and not sending it, i get VBS run time error.
>
> example: in idl:
>
> HRESULT ConfigScenario ([in, defaultvalue(NULL)] INT
> valCurrentTestSet,[in, defaultvalue(NULL)] INT temp,[out,retval] INT
> *uiApplicationIndex);
>
> and in VBS file:
>
> Dim obj,k
>
> set obj = Cretaeobject("whatever.x")
> k = obj.ConfigScenario(,) -> i get run time error.
> k = obj.ConfigScenario(512,12) -> this works fine
>
> any one knows if it is allow?
There's no reason for ',' delimiters if trailing optional arguments are
omitted, but they are needed if leading optional arguments are omitted.
k = obj.ConfigScenario() 'both default
k = obj.ConfigScenario(512) '2nd defaults
k = obj.ConfigScenario(,12) '1st defaults
-- Michael Harris Microsoft.MVP.Scripting Sammamish WA US
- Next message: Michael Harris \(MVP\): "Re: how do I remotely install WMI on w2k3?"
- Previous message: Michael Harris \(MVP\): "Re: VB script skelleton"
- In reply to: Ronen: "sending last variable defined as default from VBS to ATL object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|