Board index » cppbuilder » Multiple calls to a services exporting an interface?

Multiple calls to a services exporting an interface?

I'm trying to create a Win32 service that exports a COM interface - and so
far, so good. However, no matter what I try, I cannot get multiple calls to
overlap - only one call seems to be active at any one time.

I've tried making it "multiuse" as per MSDN docs, and played with all kinds
of multithread things, including doing my own CoInitializeEx() call.
Somehow, somewhere, it seems to be limited to one active call at any one
time.

How can I get around that, and make it able to receive several calls at one
time?

/Micke

 

Re:Multiple calls to a services exporting an interface?


I am not ure what you mean by overlapping , but if you man only one connection enters your server at a time then is sounds like a threading issue.  If it is apartment threaded all calls should be passed through the message loop.  Meaning that only one call will enter your component at one time.

If you make it free-threaded then you should be able to get calls to overlap.  

The multiuse just indicates whether or not one version of the server services several clients rather that just one server per client connection.

Hope I have helped
Dean Mitchell

Quote
"Micke 2.0" <mi...@ekcimno.spam.net> wrote:
>I'm trying to create a Win32 service that exports a COM interface - and so
>far, so good. However, no matter what I try, I cannot get multiple calls to
>overlap - only one call seems to be active at any one time.

>I've tried making it "multiuse" as per MSDN docs, and played with all kinds
>of multithread things, including doing my own CoInitializeEx() call.
>Somehow, somewhere, it seems to be limited to one active call at any one
>time.

>How can I get around that, and make it able to receive several calls at one
>time?

>/Micke

Re:Multiple calls to a services exporting an interface?


Quote
> If you make it free-threaded then you should be able to get calls to
overlap.

> The multiuse just indicates whether or not one version of the server

services several clients rather that just one server per client connection.

Yes, well .. that's what I tried. On the ATL page of the project options,
I've tried just about every option there is - despite the fact that BCB
doesn't consider W2K a COM+ platform (the "neutral" never stays set). Unless
BCB does something behind the scenes for services, I should be all set.

So, does it? I *can't* get any two calls to work simultaneously - despite
them being multithread aware, using semaphores and events and whatnot.
Someone, somewhere, is making this activeX server/services .EXE apartment-
or singlethreaded :/

/Micke

Re:Multiple calls to a services exporting an interface?


Quote
"Micke" <mi...@ekcim.no-spam.net> wrote:
>> If you make it free-threaded then you should be able to get calls to
>overlap.

>> The multiuse just indicates whether or not one version of the server
>services several clients rather that just one server per client connection.

>Yes, well .. that's what I tried. On the ATL page of the project options,
>I've tried just about every option there is - despite the fact that BCB
>doesn't consider W2K a COM+ platform (the "neutral" never stays set). Unless
>BCB does something behind the scenes for services, I should be all set.

>So, does it? I *can't* get any two calls to work simultaneously - despite
>them being multithread aware, using semaphores and events and whatnot.
>Someone, somewhere, is making this activeX server/services .EXE apartment-
>or singlethreaded :/

>/Micke

I am new to the Borland compiler, up until now I have always used MSVC.  On that implementation of ATL if you selected free-threaded inthe wizrad it was not made free-threaded until you changed the
#define _ATL_APARTMENT_THREADED to  #define _ATL_FREE_THREADED.

Is there an equivalent in Borland or can you try compileing it with that defined as it is part of ATL.

Good Luck

Re:Multiple calls to a services exporting an interface?


I seem to have the same problem. I have created an
ActiveX Library and added an Active Server Object using Apartment Threading (but I have tried all the others as well). I then added MyMethod (this simply sends/receives a string via a blocking socket
session. This therefor shows me (via the called server) how many simultaneous threads are running)

When I call the ASP page (with the imbedded COM object) simultaneously via multiple browsers, their requests are all handled serially, not in parallel as I would expect.

Re:Multiple calls to a services exporting an interface?


Quote
> When I call the ASP page (with the imbedded COM object) simultaneously via

multiple browsers, their requests are all handled serially, not in parallel
as I would expect.

Quote

Yes, well, this and other incidents, and the near impossibility to get any
kinds of answers for what I'd consider basic questions about the C++ Builder
have lead to me abandoning it. The Borland effort doesn't go the distance;
except maybe in Delphi. I have a feeling a similar question about Delphi
would have been answered.

For myself, I'm in the process of s{*word*99}ping the Builder and move on to .NET
instead. Despite being beta 1 its stability and the decent online help you
can get is like another universe, compared to Borland. Too bad, Borland.
They need some kind of active support (yes, I tried there as well), not just
pushing CDs out the front door.

Not that they read this, of course. Signing off this news server for keeps
now. Can I get my money back please? :)

/Micke

Other Threads