Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Trying to make window from MTA thread...

 
 
Old 02-18-2006   #1 (permalink)
Nick


 
 

Trying to make window from MTA thread...

I have an application running in an MTA thread, and I want to pop up an
Avalon window. So far, I've been creating the Window object in the MTA thread
and calling Window.Dispatcher.Invoke with a delegate that calls ShowDialog,
but that doesn't seem to be working...the first time it happens I get an
exception saying that the window handle is invalid, and any future times the
call works but no window appears.

Do I have to create the Window object from an STA thread, or perhaps I'm
doing something rather silly?

Thanks,
Nick

My System SpecsSystem Spec
Old 02-20-2006   #2 (permalink)
Nick Kramer [MSFT]


 
 

Re: Trying to make window from MTA thread...

MTA is not supported -- STA only.

--
-Nick Kramer [MSFT]
http://blogs.msdn.com/nickkramer

---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Nick" <Nick@discussions.microsoft.com> wrote in message
news:CFC396BD-37C0-45FF-A5F8-D846185FC410@microsoft.com...
>I have an application running in an MTA thread, and I want to pop up an
> Avalon window. So far, I've been creating the Window object in the MTA
> thread
> and calling Window.Dispatcher.Invoke with a delegate that calls
> ShowDialog,
> but that doesn't seem to be working...the first time it happens I get an
> exception saying that the window handle is invalid, and any future times
> the
> call works but no window appears.
>
> Do I have to create the Window object from an STA thread, or perhaps I'm
> doing something rather silly?
>
> Thanks,
> Nick



My System SpecsSystem Spec
Old 02-20-2006   #3 (permalink)
user@domain.invalid


 
 

Re: Trying to make window from MTA thread...

Do you mean that you can only create windows from an STA thread, or do
you mean that there isn't any possible interaction with MTA threads at all?

What I'd like to do is create a new STA thread, create a window on that,
and figure out how to start passing data to it. Is that not possible?

Thanks,
Nick
My System SpecsSystem Spec
Old 02-23-2006   #4 (permalink)
Nick Kramer [MSFT]


 
 

Re: Trying to make window from MTA thread...

Any thread with a WPF dispatcher requires STA, other non-UI threads can use
MTA.

--
-Nick Kramer [MSFT]
http://blogs.msdn.com/nickkramer

---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


<user@domain.invalid> wrote in message
news:OT5WZLnNGHA.668@TK2MSFTNGP11.phx.gbl...
> Do you mean that you can only create windows from an STA thread, or do you
> mean that there isn't any possible interaction with MTA threads at all?
>
> What I'd like to do is create a new STA thread, create a window on that,
> and figure out how to start passing data to it. Is that not possible?
>
> Thanks,
> Nick



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
How do the current thread get thread notification of OS intruption .NET General
Start a new thread from an existing thread, which was started from atimer .NET General
make window bigger Vista performance & maintenance
How to make the window smaller or get it above lower task bar Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46