Re: jawin.COMException: 8000ffff: CoCreateInstance

"Mcnamara, Sean D" <[email protected]> Tue, 17 Jan 2006 09:23:29 -0500
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <57F935D6BB6B2543AF5D835DCE7CAF270F8E08@MD61EX100.ad.honeywell-tsi.com>
Hi,

Here are a couple of things you can try:

1. If you rebuilt the DLL or TLB at any time after placing their CLSID
(either manually or using the code generator) into the Jawin stubs, you need
to get the new CLSID from them again and make sure it is reflected in your
java program.
2. Include both the .tlb and the .dll on the Java classpath, and use
loadLibrary on each from within Java. I believe Java will register the dll
appropriately if it is a COM object that you call loadLibrary on.
3. Make sure the environment you're running in for the server has permission
to register new DLLs. I know on some of our systems here, adding a new CLSID
is strictly prohibited under certain logins.
4. Use something like C++ or Visual Basic (you could even use .NET) to
create a small standalone .EXE that, basically, just creates a new instance
of your component (using the COM interface) and exits. My VB.NET knowledge
is awful, but I believe it would be something like,

Sub Main()
On Error GoTo complain
Dim x As Object
Set x = CreateObject("{long-foobar-clsid}");
Exit Sub
complain:
MsgBox "Creating object failed"
End Sub

If that CreateObject call goes through on your server by just running the
exe (or, if you want, use Runtime.exec from within your Java program), then
your system is natively supporting the COM interface you are trying to
access, and the problem lies in Jawin or otherwise your Java environment
(for instance, the stub code generated could be incorrect).

If the call does not go through, then something actually is wrong with your
environment or the registration of the COM typelib without regard to Java or
Jawin. To me, that distinction has always been critical in helping to
troubleshoot exceptions in Jawin. If you have a problem with the typelib
independent of Java, try deleting it from the registry and re-adding it
using regsvr32 or regasm, or check MSDN newsgroups for a similar problem of
being unable to call COM interfaces to .NET assemblies from other programs.

-Sean

-----Original Message-----
From: Discussion of Java/Win32/COM integration with Jawin
[mailto:[email protected]] On Behalf Of Bob Farnik
Sent: Tuesday, January 17, 2006 3:31 AM
To: [email protected]
Subject: Re: [JAWIN] jawin.COMException: 8000ffff: CoCreateInstance

Hi Adam,

I believe your point with the registry is correct.

My situation is a bit more complicated, because BSCFunctions.dll is not
ActiveX, but .NET assembly and I generated jawin stubs from the
corresponding TLB (on dev. system it was automaticaly done by VisualStudio
COM InterOp feature).

I tried to use regasm.exe to register this TLB on the target system (using
/tlb: and also /regfile: switches, but neither helped ... the error is still
the same.

I wonder what exactly jawin needs to know, when loading and initializing the
class with given CLSID and what apart of the registration can make a
difference between the class deployed from VS.NET and manual
deployment/registration.

NOTICE: This communication, including any attachment, contains information
that may be confidential or privileged,
and is intended solely for the entity or individual to whom it is addressed.
If you are not the intended recipient, please notify
 the sender at once, and you should delete this message and are hereby
notified that any disclosure, copying, or distribution
of this message is strictly prohibited. Nothing in this email, including any
attachment, is intended to be a legally binding signature.