Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.racob.com.ComFailException: IEnumVARIANT::Net when using an ASSOCIATORS query #14

Open
slackfan opened this issue Aug 12, 2014 · 0 comments

Comments

@slackfan
Copy link

Hi,

when calling the example snippet

require 'win32ole'

locator = WIN32OLE.new('WbemScripting.SWbemLocator')
service = locator.connectServer("./", "", "", "")
list = service.execQuery("ASSOCIATORS OF {Win32_LogicalDisk='C:'}")
# puts list.ole_get_methods
list.each do |item|
 puts item.Caption
end

The snippet crashes with the following exception.

EnumVariant.java:-2:in `Next': org.racob.com.ComFailException: IEnumVARIANT::Net
        from EnumVariant.java:47:in `hasMoreElements'
        from RubyWIN32OLE.java:64:in `each'
        from MethodHandle.java:636:in `invokeWithArguments'
        from InvocationLinker.java:232:in `invocationFallback'
        from playme.rb:7:in `__file__'
        from playme.rb:-1:in `load'
        from Ruby.java:811:in `runScript'
        from Ruby.java:804:in `runScript'
        from Ruby.java:673:in `runNormally'
        from Ruby.java:522:in `runFromMain'
        from Main.java:395:in `doRunFromMain'
        from Main.java:290:in `internalRun'
        from Main.java:217:in `run'
        from Main.java:197:in `main'

The query should be valid according to http://msdn.microsoft.com/en-us/library/aa384793(v=vs.85).aspx

Used versions:

  • JRuby-1.7.12
  • Oracle JDK 1.7u60 64bit
  • jruby-win32ole version 0.85
  • Operating systems: Windows 7 Professional and/or Windows Server 2008 R2, both 64bit

Do you have any idea why this happens? Is the usage wrong or is this an issue with the gem? An explanatory comment or workaround would be great and a huge help.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant