How do I find the CLSID or ProgId ?

Dag Joar Larsen <[email protected]> Tue, 30 Aug 2005 18:55:20 -0400
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <LISTSERV%[email protected]>
Hello,

I am currently trying to get Jawin to work with a proprietary DLL called
ihSDK.dll. It works fine to create the dispatch-classes with Jawin Type
Browser, and I can compile everything fine. My problem is that I don't know
which CLSID or ProgId to use when calling either the DispatchPtr constructor
or the generated _Server constructor. When I use the DispatchPtr constructor
as the following with the DIID in the DispatchPtr subclass _Server:
    try {
      Ole32.CoInitialize();
      DispatchPtr p = new DispatchPtr(_Server.DIID);

I get this error message:

org.jawin.COMException: 80040154: Class not registered

        at org.jawin.marshal.GenericStub.win32Invoke0(Native Method)
        at org.jawin.marshal.GenericStub.win32Invoke(GenericStub.java:152)
        at org.jawin.FuncPtr.invoke(FuncPtr.java:186)
        at org.jawin.FuncPtr.invoke(FuncPtr.java:205)
        at org.jawin.win32.Ole32.CoCreateInstance(Ole32.java:169)
        at org.jawin.COMPtr.<init>(COMPtr.java:134)
        at org.jawin.DispatchPtr.<init>(DispatchPtr.java:82)
        at com.mapgraph.exporter.iHistorianReader.<init>(iHistorianReader.
java:18)
        at com.mapgraph.exporter.iHistorianReader.main(iHistorianReader.
java:41)

If I try to use "make up" my own ProgId like the following code:

    try {
      Ole32.CoInitialize();
      server = new _Server("iHistorianSDK.ReaderTest");

I get the following error

org.jawin.COMException: 800401f3: Invalid class string

        at org.jawin.marshal.GenericStub.win32Invoke0(Native Method)
        at org.jawin.marshal.GenericStub.win32Invoke(GenericStub.java:152)
        at org.jawin.FuncPtr.invoke(FuncPtr.java:186)
        at org.jawin.FuncPtr.invoke(FuncPtr.java:205)
        at org.jawin.win32.Ole32.CLSIDFromProgID(Ole32.java:115)
        at org.jawin.win32.Ole32.GetFromProgID(Ole32.java:95)
        at org.jawin.COMPtr.<init>(COMPtr.java:126)
        at org.jawin.DispatchPtr.<init>(DispatchPtr.java:93)
        at com.ihistorian._Server.<init>(_Server.java:45)
        at com.mapgraph.exporter.iHistorianReader.<init>(iHistorianReader.
java:21)
        at com.mapgraph.exporter.iHistorianReader.main(iHistorianReader.
java:41)


How do I find the correct CLSID or ProgID to use?