Is anybody having a problem with attaching an existing window?

67 views
Skip to first unread message

John Hobbs

unread,
Jul 10, 2006, 10:37:45 AM7/10/06
to wa...@googlegroups.com
Hi,

Is anybody having a problem with attaching an existing window using Watij 3.0?  All of my test cases require this feature.  When I try to attach an existing IE window, I get a the following error:

com.jniwrapper.win32.com.ComException: COM object method returns error code: 0x80040154; Class not registered

I decided to build Watij on my machine and then run the WatijTestCases.  All but three of the of the tests passed.  The following test cases had errors::

  • AttachToExistingWindowTest
  • AttachToNewWindowTest
  • ChildBrowserTest

Here is a sample of the error:

java.lang.reflect.InvocationTargetException at com.jniwrapper.win32.MessageLoopThread.doInvokeAndWait(MessageLoopThread.java:225) at watij.runtime.ie.IEController.attach(IEController.java:247) at watij.runtime.ie.IEController.attachByTitle(IEController.java:242) at watij.IE.attach(IE.java:100) at watij.AttachToExistingWindowTest.testExistingWindow(AttachToExistingWindowTest.java:19)Caused by: com.jniwrapper.win32.com.ComException: COM object method returns error code: 0x80040154; Class not registered at com.jniwrapper.win32.com.ComException.checkResult(SourceFile:72) at com.jniwrapper.win32.com.ComFunctions.coCreateInstance(SourceFile:140) at com.jniwrapper.win32.com.impl.IUnknownImpl.<init>(SourceFile:73) at com.jniwrapper.win32.automation.impl.IDispatchImpl.<init>(SourceFile:53) at watij.shdocvw.impl.IShellWindowsImpl.<init>(IShellWindowsImpl.java:38) at watij.shdocvw.ShellWindows.create(ShellWindows.java:31) at watij.runtime.ie.IEController$AttachByTitleOrUrl.run(IEController.java:262) at com.jniwrapper.win32.MessageLoopThread$ThreadSynchronizedAction.run(MessageLoopThread.java:531) at com.jniwrapper.win32.MessageLoopThread$LoopThread.run(MessageLoopThread.java:480)

Any ideas?

Thanks
John



Brian Knorr

unread,
Jul 10, 2006, 11:25:41 AM7/10/06
to wa...@googlegroups.com
It looks like your shdocvw.dll is not registered properly...what version of windows are you running?  Also try opening up regedit and search for the clsid "9BA05972-F6A8-11CF-A442-00A0C90A8F39" to see if it is in the windows registry.  If it's not there try running this from the command line "regsvr32 shdocvw.dll" and do the search again.
 
Thanks,
 
Brian
 
 
On 7/10/06, John Hobbs <jhob...@gmail.com> wrote:
Hi,

Is anybody having a problem with attaching an existing window using Watij 3.0?  All of my test cases require this feature.  When I try to attach an existing IE window, I get a the following error:

com.jniwrapper.win32.com.ComException: COM object method returns error code: 0x80040154; Class not registered
 

I decided to build Watij on my machine and then run the WatijTestCases.  All but three of the of the tests passed.  The following test cases had errors::

  • AttachToExistingWindowTest
  • AttachToNewWindowTest
  • ChildBrowserTest

Here is a sample of the error:

java.lang.reflect.InvocationTargetException at com.jniwrapper.win32.MessageLoopThread.doInvokeAndWait(MessageLoopThread.java:225) at watij.runtime.ie.IEController.attach (IEController.java:247) at watij.runtime.ie.IEController.attachByTitle(IEController.java:242) at watij.IE.attach(IE.java:100) at watij.AttachToExistingWindowTest.testExistingWindow(AttachToExistingWindowTest.java:19)Caused by: com.jniwrapper.win32.com.ComException: COM object method returns error code: 0x80040154; Class not registered at com.jniwrapper.win32.com.ComException.checkResult(SourceFile:72) at com.jniwrapper.win32.com.ComFunctions.coCreateInstance (SourceFile:140) at com.jniwrapper.win32.com.impl.IUnknownImpl.<init>(SourceFile:73) at com.jniwrapper.win32.automation.impl.IDispatchImpl.<init>(SourceFile:53) at watij.shdocvw.impl.IShellWindowsImpl.<init>( IShellWindowsImpl.java:38) at watij.shdocvw.ShellWindows.create(ShellWindows.java:31) at watij.runtime.ie.IEController$AttachByTitleOrUrl.run(IEController.java:262) at com.jniwrapper.win32.MessageLoopThread$ThreadSynchronizedAction.run (MessageLoopThread.java:531) at com.jniwrapper.win32.MessageLoopThread$LoopThread.run(MessageLoopThread.java:480)
 

Any ideas?

Thanks
John






 

John Hobbs

unread,
Jul 11, 2006, 9:17:59 AM7/11/06
to wa...@googlegroups.com
I'm running Windows 2000 Service Pack 4

I opened regedit and searched for "9BA05972-F6A8-11CF-A442-00A0C90A8F39", but nothing was found.  I then ran "regsvr32 shdocvw.dll" from the command line.  This returned "DllRegisterServer in shdocvw.dll succeeded."  I did the search again and "9BA05972-F6A8-11CF-A442-00A0C90A8F39" still wasn't found.

I did try to attach a window using Watij 3.0 in hopes that we had a fix, but I'm still getting the "Class not registered" COMException.

John

Terpentin

unread,
Jul 12, 2006, 5:13:48 AM7/12/06
to watij
Hi John,

I met the same problem.

Try this command to register the .dll: "regsvr32.exe /i shdocvw.dll".
This should return "DllRegisterServer and DllInstall in shdocvw.dll
succeeded."

Attaching existing windows works for me now.

Cheers,
Andreas

John Hobbs

unread,
Jul 12, 2006, 9:42:07 AM7/12/06
to wa...@googlegroups.com
Hi Andreas,

That worked!  I can now attach existing windows!

Thank you very much!

Tschüß!,
John
Reply all
Reply to author
Forward
0 new messages