HighTechTalks DotNet Forums  

How can I change the thread apartment when instancing a .Net Remoting active client type?

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss How can I change the thread apartment when instancing a .Net Remoting active client type? in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
rschupbach@gmail.com
 
Posts: n/a

Default How can I change the thread apartment when instancing a .Net Remoting active client type? - 02-19-2007 , 04:19 PM






When instancing a remote object (active client type), the current
thread apartment state is Unknown. I need to access an ActiveX control
inside this process and it requires a STA model. Both application
(Client & Server) are STA type by using the [STAThread] before the
Main();

Who can I change or instantiate the threat with a STA model for my
remoting object?

The System.Threading.Thread.CurrentThread.ApartmentSta te = Unknown in
the Initialize function.

Here is my code:
//**** Client ****
ChannelServices.RegisterChannel(new TcpChannel());

System.Runtime.Remoting.ActivatedClientTypeEntry entry = new
ActivatedClientTypeEntry(typeof(MapComponent), "tcp://localhost:302");
RemotingConfiguration.RegisterActivatedClientType( entry);
mapComponent = new TelDig.MappingTools.TdgMapComponent.MapComponent() ;
mapComponent.Initialize();

//**** Server ****
ChannelServices.RegisterChannel(new TcpChannel(302));
RemotingConfiguration.RegisterActivatedServiceType (typeof(MapComponent));

Thanks for the help.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.