468,720 Members | 1,647 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,720 developers. It's quick & easy.

ActiveX Enumerations

Hi,

I'm using a COM DLL (created in VB) in my javascript code and can
successfully call its methods and get/set its properties. There are
also some Public enumerations defined in the ActiveX DLL I'd like to
access -- is this possible?

Thanks,

Joe

Jul 23 '05 #1
3 1516
JoeH wrote:
Hi,

I'm using a COM DLL (created in VB) in my javascript code and can
successfully call its methods and get/set its properties. There are
also some Public enumerations defined in the ActiveX DLL I'd like to
access -- is this possible?


Not being an expert, my best bet would be to use an Enumerator (JScript
specific).

The following short example may get you started:

var wmi = new
Enumerator(GetObject("winmgmts:").InstancesOf("Win 32_process"));

for( ; !wmi.atEnd(); wmi.moveNext() )
{
var process = wmi.item();
alert( "process.name" );
}
I've told that this Enumerator stuff helps iterating (using atEnd,
moveNext and Item) through COM enumerations.

Hope this helps,

Alexis
Jul 23 '05 #2
JoeH wrote:
I'm using a COM DLL (created in VB) in my javascript code and can
successfully call its methods and get/set its properties. There are
also some Public enumerations defined in the ActiveX DLL I'd like to
access -- is this possible?


My best bet would be to use an Enumerator (JScript specific).

The following short example may get you started:

var wmi = new
Enumerator(GetObject("winmgmts:").InstancesOf("Win 32_process"));

for( ; !wmi.atEnd(); wmi.moveNext() )
{
var process = wmi.item();
alert( "process.name" );
}
I'm being told that this Enumerator stuff helps iterating (using atEnd,
moveNext and item methods) through COM enumerations.

Cheers,

Alexis
Jul 23 '05 #3
Thanks Alexis,

I was hoping I'd be able to reference the enumeration items (from the
DLL) by name vs. looping through them -- but this was an informative
code snippet nonetheless.

Regards,

Joe

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Plinkerton | last post: by
21 posts views Thread by Christopher Benson-Manica | last post: by
5 posts views Thread by Seamus M | last post: by
1 post views Thread by someone else | last post: by
1 post views Thread by Oleg Ogurok | last post: by
4 posts views Thread by ChrisB | last post: by
77 posts views Thread by Ben Finney | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Oskars | last post: by
9 posts views Thread by bryonone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.