Page 1 of 1

Update on iMacros using Java

Posted: Wed Jun 14, 2006 11:49 am
by Tech Support
[update] The wrapper below refers to the obsolete COM object "InternetMacros.iim", which now is simply called "imacros". To use the wrapper, you will need to replace this string in the class "IMacrosWrapper.java" (line 133) until a new wrapper is released.

Code: Select all

public class IMacrosWrapper implements RegistryConstants
{
   /* Instead of providing the CLSID, which might be difficult to
   * obtain and might also change due to changes in the Scripting
   * Interface, the Registry is now queried for the correct CLSID
   * using the ProgID, which is (hopefully) easier to obtain
   */   
   //private static final String standardProgID = "InternetMacros.iim"; // <-- old name
   private static final String standardProgID = "imacros";
[End of update]

Hi,

We updated the IMacrosWrapper class which facilitates the usage of the Scripting Interface and Java classes. The most important fixes:

0) Names changed to standard names, i.e. with a preceeding iim as in iimPlay(). The old names were kept for downward compatibility. That means that when compiling a class which uses these methods you will get a "Class uses deprecated methods" message by the Java compiler.
However, the class will compile and it will not fail during run time.

1) getLastMessage() and exitAllBrowsers() are not longer supported by the Scripting Interface, thus they were marked deprecated. That means that when compiling a class which uses these methods you will get a "Class uses deprecated methods" message by the Java compiler.
Please note that, although the class will compile, it will fail during run time due to the non-existance of the functions in the iimInterface.dll. This message will be

Code: Select all

org.jawin.COMException: 80020006: Unknown name.
2) The timeout option is now available in calls to iimPlay(), iimDisplay() and iimExit()

3) Return types changed from Short to Integer

4) The CLSID of the iimInterface.dll, which is needed to establish connection between Java and the Scripting Interface, is now dynamically retrieved from the Registry. For this retrieval the ProgID of the dll is needed, which is InternetMacros.iim. This ProgID is used when the standard constructor

Code: Select all

IMacroWrapper()
is used. Since the ProgID might change, I also added a new constructor

Code: Select all

IMacrosWrapper(String progId)
which takes the ProgID as argument.

5) The initialization of the jawin bridge to the iimInterface.dll is now included in the iimInit() call (instead of the constructor) and the uninitialization is included in the iimExit() call. That means that the method close() is also deprecated.

Regards
---
Lasse Clausen, iOpus Support

Thanks

Posted: Wed Jun 14, 2006 4:58 pm
by pigsie
Thanks

This is a life saver as it should fix the unknown name error I was geting.

Posted: Sat Jan 20, 2007 11:20 pm
by jstatham
I have followed the instructions at http://www.iopus.com/imacros/tutorials/java.htm
and when I try to compile I get the following error:

cannot access org.jawin.COMException
class file for org.jawin.COMException not found
result = imacros.iimInit();

Can anyone help???

Posted: Thu Feb 15, 2007 1:22 pm
by mrLenin
Sorry, but no. I didn't get such error.

Error while running the JavaWrapper Test Program

Posted: Tue Nov 06, 2007 4:54 am
by vickyd
Hi,

I am trying out this great product to integrate with our application which is in Java.

I have downloaded jawin from http://sourceforge.net/projects/jawinproject/ and wrapper class from http://www.iopus.com/download/imacroswrapper.zip

When I run the test program provided with the example, I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/jawin/win32/RegistryConstants

Am I using wrong version of Jawin or wrapper class? Please advise and point me to the correct combination of these libraries.


Thanks