Hi everybody,
I am baffled by this problem and was hoping that somebody could help me out.
I have a COM DLL that was created by Delphi that I am calling indirectly
within my web service. The WS is calling a .NET component that calls the
COM DLL. I unit test the .NET component and it works fine. As soon as I
make calls from within the web service, I get the following error:
Unable to cast COM object of type 'ABDelphiLib.MathLibClass' to interface
type 'ABDelphiLib.IMathLib'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{A48ACC15-ADCB-4759-BA41-C9541E97601E}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
Trace Information: at ABDelphiLib.MathLibClass.RoundFloat(Double rInput,
Int32 iDigits)
I looked at the interop file that Visual Studio created, and it has the same
results as one that I would create with tblimp. I made sure the interop
assembly is in the BIN directory of my web service app. I also made sure
the native com component is in that directory, although it was already
registered with regsvr32. I am running the tests against the same machine.
Why doesn't this work within the web service when it works when I test the
.Net assembly?
Thanks in advance,
cj
Patrick Steele - 21 Feb 2007 21:40 GMT
> Why doesn't this work within the web service when it works when I test the
> .Net assembly?
This might shed some light (depending on the apartment threading model
of your Delphi object):
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q303375

Signature
Patrick Steele
http://weblogs.asp.net/psteele
Curtis Justus - 22 Feb 2007 16:13 GMT
Hi Patrick,
I spoke to the developer who gave me the DLL. I think he didn't make the
interface publically available, although I was able to see it in the ildasm.
Oh well, it is working now, so I can fix the hole in the wall that is the
shape of my head ;-).
Take care,
cj
>> Why doesn't this work within the web service when it works when I test
>> the
[quoted text clipped - 4 lines]
>
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q303375