[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Interop within a web service

Curtis Justus

2/21/2007 3:07:00 PM

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


2 Answers

Patrick Steele

2/21/2007 9:40:00 PM

0

In article <#OMlwncVHHA.1036@TK2MSFTNGP03.phx.gbl>,
nospam@cjustus.m.s.com says...
> 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-...

--
Patrick Steele
http://weblogs.asp.n...

Curtis Justus

2/22/2007 4:13:00 PM

0

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

"Patrick Steele" <patrick@mvps.org> wrote in message
news:MPG.2046864256938c6198970d@msnews.microsoft.com...
> In article <#OMlwncVHHA.1036@TK2MSFTNGP03.phx.gbl>,
> nospam@cjustus.m.s.com says...
>> 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-...
>
> --
> Patrick Steele
> http://weblogs.asp.n...