Re: generated stubs fail to compile

Florian Schmitt <[email protected]> Tue, 25 Jul 2006 09:38:03 -0400
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <LISTSERV%[email protected]>
Hi Christophe,

On Mon, 17 Jul 2006 02:17:25 -0400, Christophe Grosjean
<[email protected]> wrote:

>I tried to use the typebrowser to generate the stubs for Microsoft Word
>using the file MSWORD.olb from the MsOffice installation folder.
>
>But the collection of generated Java classes does not compile... It seems
>there are missing methods like Application.stealUnknown... In fact the
>Application class is almost empty (except the GUID).
>
>Any idea of what can I do ?

try to replace 'Application' by '_Application':

 public _Application getApplication() throws COMException
    {
       _Application res = new _Application();
          DispatchPtr dispPtr = (DispatchPtr)get("Application");
          res.stealUnknown(dispPtr);
          return res;
    }

Of course the JaWin Stub _Application has to be available.

The same problem occurs in other typebrowser-created classes who try to
reference e.g. Document instead of _Document and so on. Usually there exists
 a Stub class that implements DispatchPtr and this way inherits stealUnknown().

HTH
F. Schmitt