Problem with DispatchPtr

Tobias Widmer <[email protected]>
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <LISTSERV%[email protected]>
Hi,

The main method of the sample code in the package is

public static void main(String[] args) {
   try {
 DispatchPtr app = new DispatchPtr("Word.Application");
 app.put("Visible", true);}
   catch (Exception e) {
      e.printStackTrace();}
}

and the code works well.  Within my project I need to invoke the COM-object
methods WITHOUT a DispatchPtr.  Therefore I tried the following:

public static void main(String[] args) {
   try {
 _Application app = new _Application();
 app.HelpTool();}
   catch (Exception e) {
      e.printStackTrace();}
}

which should be okay because the class _Application was generated by Jawin.
 The method HelpTool() is defined in _Application.  The debugger told me
that the new object app has been created, but once app.HelpTool() is being
compiled, there occurs this error:

compile:
org.jawin.COMException: 8000ffff: NULL GIT peer
    at org.jawin.marshal.GenericStub.dispatchInvoke0(Native Method)
    at org.jawin.marshal.GenericStub.dispatchInvoke(GenericStub.java:84)
    at org.jawin.DispatchPtr.invokeN(DispatchPtr.java:473)
    at org.jawin.DispatchPtr.invokeN(DispatchPtr.java:433)
    at com.jawin.demo.doc._Application.HelpTool(_Application.java:1479)
    at com.jawin.demo.main.Main.main(Main.java:41)
debug:
BUILD SUCCESSFUL (total time: 17 seconds)

So my question is this:  Is there a way to implement this without a
DispatchPtr, and if yes, how??

Thanks,
Tobias
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.