On Feb 28, 1:02 pm, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.be> wrote:
> <alexia....@gmail.com> wrote in message
>
[quoted text clipped - 65 lines]
>
> Willy.
Hi Willy,
I don't want to write hard coded the val 32, I want to use it in the
following way:
Set eiObj = createobject("EIServices.Network")
stat = eiObj.SetDeviceState (...,...)
if stat <> stat.ieSUCCESS Then...
Willy Denoyette [MVP] - 02 Mar 2008 17:34 GMT
On Feb 28, 1:02 pm, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.be> wrote:
> <alexia....@gmail.com> wrote in message
>
[quoted text clipped - 65 lines]
>
> Willy.
Hi Willy,
I don't want to write hard coded the val 32, I want to use it in the
following way:
Set eiObj = createobject("EIServices.Network")
stat = eiObj.SetDeviceState (...,...)
if stat <> stat.ieSUCCESS Then...
Well you will need to use Windows Scripting Host (WSH) for this (search MSDN
for details).
In you script file you need to add a "reference" tag to set a reference to
the typelib generated by regasm (or VS) for your component.
Also you need to watch when using enum names in script, use an _ instead of
a dot, for instance if you have an enum in C# that looks like Color.Green,
then you need to specify Color_Green in script.
Here is a simple sample to illustrate the usage, substitute your own
"typelib" uuid with the one in the sample. You can obtain the typelib guid
by looking into the registry or simply by running oleview on your typelib
(somefile.tlb).
<?XML version="1.0" ?>
<package>
<job>
' uuid of the typelib, dont use reference object = ....!
<reference guid="{98C2D27D-99F6-3DB3-9BB3-508D35BCA248}"/>
<script language="vbscript">
' create an instance of a C# class
set o = WScript.CreateObject("xxxx.yyyy")
' call a method that retruns an enum (Color) value
val = o.GetColor()
If val = Color_Green Then
WScript.Echo "Green"
End If
</script>
</job>
</package>
Hope this helps.
Willy.