Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / February 2007

Tip: Looking for answers? Try searching our database.

Interop within a web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Curtis Justus - 21 Feb 2007 15:06 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.