ActiveX Enumerations

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JoeH

    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

  • Alexis Nikichine

    #2
    Re: ActiveX Enumerations

    JoeH wrote:[color=blue]
    > 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?[/color]

    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(GetO bject("winmgmts :").InstancesOf ("Win32_process "));

    for( ; !wmi.atEnd(); wmi.moveNext() )
    {
    var process = wmi.item();
    alert( "process.na me" );
    }


    I've told that this Enumerator stuff helps iterating (using atEnd,
    moveNext and Item) through COM enumerations.

    Hope this helps,

    Alexis

    Comment

    • Alexis Nikichine

      #3
      Re: ActiveX Enumerations

      JoeH wrote:
      [color=blue]
      > 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?[/color]

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

      The following short example may get you started:

      var wmi = new
      Enumerator(GetO bject("winmgmts :").InstancesOf ("Win32_process "));

      for( ; !wmi.atEnd(); wmi.moveNext() )
      {
      var process = wmi.item();
      alert( "process.na me" );
      }


      I'm being told that this Enumerator stuff helps iterating (using atEnd,
      moveNext and item methods) through COM enumerations.

      Cheers,

      Alexis

      Comment

      • JoeH

        #4
        Re: ActiveX Enumerations

        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

        Comment

        Working...