|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
remoting configuration STAApparently ActiveX controls can only be created in STAThreads. When I make the following call from the client: _myRemoteObject = (IRemoteObject) Activator.GetObject( typeof(MyLib.IRemoteObject), host ); I keep getting the following error: {"Could not instantiate ActiveX control 'd5b7f60a-c223-4556-845d-fe5f59e49f03' because the current thread is not in a single-threaded apartment." } I did some searching on the error and people seem to recommend starting threads as STAThreads. But both my server and client were started as STAThread. Something is happening when I make the GetObject() call. When I step into the constructor for my remote object it says that I am in a MTA thread. Does anyone know what I am doing wrong? Is there something that I can put into my remoting configuration file to specify that the remote object should be created in an STAThread? -Corey ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Show quote
"cwineman" <m*@home.com> wrote in message You can't use ActiveX controls (Full controls or OCX's) in such scenarios.news:1135010058_59@spool6-east.superfeed.net... >I am trying to create a remote object that instantiates an ActiveX control. >Apparently ActiveX controls can only be created in STAThreads. When I make >the following call from the client: > > _myRemoteObject = (IRemoteObject) Activator.GetObject( > typeof(MyLib.IRemoteObject), host ); > > I keep getting the following error: > > {"Could not instantiate ActiveX control > 'd5b7f60a-c223-4556-845d-fe5f59e49f03' because the current thread is not > in a single-threaded apartment." } > > I did some searching on the error and people seem to recommend starting > threads as STAThreads. But both my server and client were started as > STAThread. Something is happening when I make the GetObject() call. When I > step into the constructor for my remote object it says that I am in a MTA > thread. > > Does anyone know what I am doing wrong? Is there something that I can put > into my remoting configuration file to specify that the remote object > should be created in an STAThread? > > -Corey > > > ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet > News==---- > http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ > Newsgroups > ----= East and West-Coast Server Farms - Total Privacy via Encryption > =---- Full controls, need an control container as host (that is a process that has a UI and a form that hosts the AX control), your remote process is not such an host I guess. Willy. I see. I was afraid of something like that. I don't know that much
ActiveX/OCX controls, but I suspected that my problem was of the "you can't get there from here" variety. So it looks like I will have to have a process ( running the OCX control with GUI and all) running on a remote machine and create my own mechanism for communicating from clients with that process. Basically, to do everything that .NET remoting does, without actually using the .NET remoting framework. Has anyone else done something similar? Can you recommend and tools, libraries, or design patterns that were useful? Show quote "Willy Denoyette [MVP]" <willy.denoye***@telenet.be> wrote in message ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----news:uQkiEuLBGHA.3936@TK2MSFTNGP12.phx.gbl... > > "cwineman" <m*@home.com> wrote in message > news:1135010058_59@spool6-east.superfeed.net... >>I am trying to create a remote object that instantiates an ActiveX >>control. Apparently ActiveX controls can only be created in STAThreads. >>When I make the following call from the client: >> >> _myRemoteObject = (IRemoteObject) Activator.GetObject( >> typeof(MyLib.IRemoteObject), host ); >> >> I keep getting the following error: >> >> {"Could not instantiate ActiveX control >> 'd5b7f60a-c223-4556-845d-fe5f59e49f03' because the current thread is not >> in a single-threaded apartment." } >> >> I did some searching on the error and people seem to recommend starting >> threads as STAThreads. But both my server and client were started as >> STAThread. Something is happening when I make the GetObject() call. When >> I step into the constructor for my remote object it says that I am in a >> MTA thread. >> >> Does anyone know what I am doing wrong? Is there something that I can put >> into my remoting configuration file to specify that the remote object >> should be created in an STAThread? >> >> -Corey >> >> >> ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet >> News==---- >> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ >> Newsgroups >> ----= East and West-Coast Server Farms - Total Privacy via Encryption >> =---- > > > You can't use ActiveX controls (Full controls or OCX's) in such > scenarios. > Full controls, need an control container as host (that is a process that > has a UI and a form that hosts the AX control), your remote process is not > such an host I guess. > > Willy. > > > http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =---- |
|||||||||||||||||||||||