[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

Problems with .NET remoting and single threaded COM components

js

7/12/2004 9:27:00 AM

I have some problems when I try to call some old COM components from a
remote :NET object. I am pretty sure that the problem is caused by the
fact that the COMponents are single threaded, since apartment threaded
COMponents works just fines.

Is there a workaround that would enable me to included single threaded
COMomponents in my remote .NET application? I can't just rebuild them
as apartment threaded since I don't have the code.

Regards,
Jakob Skriver
2 Answers

Sunny

7/12/2004 8:11:00 PM

0

The only way I can think of is to create a new thread, mark it as STA
and make it call the COM. Actually I had to do this once :)
All remoting calls are invoked on a ThreadPool threads, which are MTA
and this can not be changed.

Sunny

In article <51992642.0407120127.142106f@posting.google.com>,
js@rapidis.com says...
> I have some problems when I try to call some old COM components from a
> remote :NET object. I am pretty sure that the problem is caused by the
> fact that the COMponents are single threaded, since apartment threaded
> COMponents works just fines.
>
> Is there a workaround that would enable me to included single threaded
> COMomponents in my remote .NET application? I can''t just rebuild them
> as apartment threaded since I don''t have the code.
>
> Regards,
> Jakob Skriver
>

js

7/14/2004 1:22:00 PM

0

Thanks a lot.

That did it after I also changed the Thread attribute in the server
application from [STAThread] to [MTAThread].

Jakob


Sunny <sunny@newsgroups.nospam> wrote in message news:<O0HVoxEaEHA.1000@TK2MSFTNGP12.phx.gbl>...
> The only way I can think of is to create a new thread, mark it as STA
> and make it call the COM. Actually I had to do this once :)
> All remoting calls are invoked on a ThreadPool threads, which are MTA
> and this can not be changed.
>
> Sunny
>
> In article <51992642.0407120127.142106f@posting.google.com>,
> js@rapidis.com says...
> > I have some problems when I try to call some old COM components from a
> > remote :NET object. I am pretty sure that the problem is caused by the
> > fact that the COMponents are single threaded, since apartment threaded
> > COMponents works just fines.
> >
> > Is there a workaround that would enable me to included single threaded
> > COMomponents in my remote .NET application? I can''t just rebuild them
> > as apartment threaded since I don''t have the code.
> >
> > Regards,
> > Jakob Skriver
> >