Re: getting GUID from dispatches

Paul Schauble <[email protected]> Mon, 5 Feb 2007 15:33:14 -0800
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <0165EECEBB4CF745ACF095E1176B03EA0D56159E@SUNCA-EXB-AV1.ticketmaster.corp>
I'm not a Java guru, but I do understand COM.

There are 2 usual ways to do this.

First is to call LoadTypeLib passing the name of the exe of dll file.
This returns an ITypeInfo interface for the type library contained in
the executable.

The second is to create one of the coclasses and call
IDispatch::GetTypeInfo. This returns a point to an ITypeInfo interface
that contains the relevant type library.=20

In either case, you can use the ITypeInfo interface to read the type
library and get the information you need.

    ++PLS

-----Original Message-----
From: Discussion of Java/Win32/COM integration with Jawin
[mailto:[email protected]] On Behalf Of Aldo Kurnia
Sent: Monday, February 05, 2007 3:58 PM
To: [email protected]
Subject: [JAWIN] getting GUID from dispatches

Hi,
I have been trying to get the GUIDs from a dll file so I don't have
hard-code it in jawin's auto-generated java files (which will break when
the
GUID changes, and it will change).

I'm able to do this for the co-classes by reading the registry value in
HKEY_CLASSES_ROOT/<function_name>, but dispatches are stored in the
HKEY_CLASSES_ROOT/Interfaces/<{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx}>
subkeys, and in my case, there are 3-4 keys with the same value
(probably
from previous versions of the dll), and it's impossible to determine
which
one the correct key.

Is there a way to get the GUIDs for the dispatches without going through
the
registry and without using ProgID?

I also haven't been able to determine how jawin was able to get the
GUIDs in
the first place.

Any suggestion would be greatly appreciated.

Thank you.