Re: 8002801d: Library not registered.
Gordon DuQuesnay <[email protected]> Fri, 11 Nov 2005 09:06:06 -0500
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <[email protected]> |
Here is the code and stack trace:
{
ICaptureServer2 capSvr = new ICaptureServer2("DCCaptureSvr.CaptureServer");
int[] num = new int[1];
capSvr.GetNumCaptureScripts(num);
}
org.jawin.COMException: 8002801d: Library not registered.
at org.jawin.marshal.GenericStub.dispatchInvoke0(Native Method)
at org.jawin.marshal.GenericStub.dispatchInvoke(GenericStub.java:201)
at org.jawin.DispatchPtr.invokeN(DispatchPtr.java:587)
at org.jawin.DispatchPtr.invokeN(DispatchPtr.java:555)
at ICaptureServer2.GetNumCaptureScripts(ICaptureServer2.java:183)
at test2.main(test2.java:27)
Exception in thread "main"
I also had this problem with another dll, it contained an interface
IDataInput2 implemented by the class "PrintServer.DataInput2". I was able to
work around it though because the same dll contained another (older?)
interface/class IDataInput/"Datacard.PrintServer.Input". The second (older?)
one worked without problems.
I noticed that when I tried to "View Type Information" of the DataInput2
Class using OLE Viewer I got a similar error
"LoadRegTypeLib(2807962821, 298952835, ...) failed.
Library not registered.
TYPE_E_LIBNOTREGISTERED($8002801D)"
Much thanks for the help Robert
Kind Regards
Gordon DuQuesnay
On 11/10/05, Robert Hastings <[email protected]> wrote:
>
> If you used OLE View to view the typelibrary then it sounds like it should
> be registered correctly. I don't know if jawin itself tries to load the
> typelib too. Is there a stack trace to go with that exception?
>
> Thanks,
> Robert
>
> -----Original Message-----
> From: Discussion of Java/Win32/COM integration with Jawin
> [mailto:[email protected]] On Behalf Of Gordon DuQuesnay
> Sent: Thursday, November 10, 2005 2:12 PM
> To: [email protected]
> Subject: Re: [JAWIN] 8002801d: Library not registered.
>
> Thanks for your response Robert,
>
> Unfortunately I don't have access to the source for the dll, however, the
> documentation for the component states:
>
> "ICaptureServer2 is a COM component that implements a "dual
> interface". It includes eight methods.
> The original ICaptureServer interface and the ICaptureServer1
> interface still exist and components created with previous versions of
> the SDK will continue to work. ICaptureServer2 contains all the
> methods of the earlier interfaces plus the GetBinaryScriptInfo.()
> methods."
>
> is there any way to verify that it is a dual interface without access to
> the
> source?
>
> I have used OLE View to view the interface... it looks like this:
> **********************
> Interface=
> ...
> ...
> TypeLib=
> l...{7398F007-2E17-46B5-A1AA-7FDF87EDB818}
> l...5.0[PrimaryInteropAssemblyName] = IDWorks.CaptureServer.Interop,
> Version=5.0.0.0 <http://5.0.0.0> <http://5.0.0.0>, Culture=neutral....
> l...5.0[PrimaryInteropAssemblyCodeBase]
> =file:///C:/ProgramFiles/Datacard/ID
> Works/BIN/IDWorks.CaptureServer.Interop.DLL
> l..5.0[<no name>]=IDWorks Capture Server
> l...0
> l l...win32=C:\Program Files\Datacard\ID Works\bin\dccapturesvr.dll
> l...Flags=0
> l...HELPDIR=C:\Program Files\Datacard\ID Works\bin\
>
> *******************************
>
> the HKEY_CLASSES_ROOT\TypeLib\{7398F007-2E17-46B5-A1AA-7FDF87EDB818} key
> is
> in the registry.
>
> I had generated the code from the dccapturesvr.dll
>
> and used:
> ICaptureServer2 capSvr = new ICaptureServer2("DCCaptureSvr.CaptureServer
> ");
> to instantiate the class.
>
> Using OLE View i have saved the type information as a .idl file I am
> currently trying to find a way to compile this to a .tlb and register it
> (just incase *shrug*)
>
> Thanks again for the help
> Kind Regards
> Gordon
>
>
> On 11/10/05, Robert Hastings <[email protected]> wrote:
> >
> > Sounds like your JTB code is calling Invoke and the type library for the
> > interface is not registered. Is the interface marked as [dual]? On the
> C++
> > side implementing a [dual] interface is pretty easy. You first implement
> > the
> > methods in C++. Then to support IDispatch::Invoke you simply look-up the
> > type-library containing the interface and then lookup the ITypeInfo of
> the
> > interface and finally call ITypeInfo::Invoke. ITypeInfo::Invoke will
> > convert
> > the arguments and call your C++ method. So my guess is that this is what
> > is
> > going on and the type-library lookup is failing. Is the type-library
> > registered? Do you have OLE View? If so you can find the interface and
> > then
> > find what type-library it is in. If not you can do the same thing with
> > regedit. I picked a random interface on my machine to give you an
> example.
> > The default key value is the GUID of the type library.
> >
> >
> HKEY_CLASSES_ROOT\Interface\{E10F0558-B0BC-4AEC-BAE6-1456F9607639}\TypeLib
> >
> >
> >
> >
>
> HKEY_CLASSES_ROOT\TypeLib\{73C4A85C-DF36-4B31-9A50-FE3A432DA2AB}\1.0\0\win32
> >
> > The default value is the path to the .tlb,.dll, or .exe (any resource
> > continer) that contains the typelibrary. If you have OLE View try to
> open
> > the type-library. Sometimes it's not the type-library but one that it
> > depends on.
> >
> > Hope this helps,
> > Robert
> >
> > -----Original Message-----
> > From: Discussion of Java/Win32/COM integration with Jawin
> > [mailto:[email protected]] On Behalf Of Gordon DuQuesnay
> > Sent: Thursday, November 10, 2005 8:10 AM
> > To: [email protected]
> > Subject: [JAWIN] 8002801d: Library not registered.
> >
> > I am getting the following error when trying to call functions using the
> > code generated by the TypeBrowser.
> >
> > org.jawin.COMException: 8002801d: Library not registered.
> >
> > I don't have much COM experience. But as far as I can tell the dll is
> > registered.
> >
> > Any insight would be much appreciated.
> > Regards
> > Gordon DuQuesnay
> >
>