469,964 Members | 1,684 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

How to create a window on a non UI thread within a C++\Clr?


To begin with we have an archetecture which has a manager Asssembly which
loads "Plug-in" assemblies using reflection, when a the UI prompts the

This loading of the assemblies and initialization is done in a seperate
thread from the UI, to keep the UI from being locked up.

Unfortuately 1 of the plug in assemblies provides a interface to a 3rd party
sdk which is in C++. So the c++\clr assembly wraps the sdk, and seems to
work fine when I test it from a form. The catch with this 3rd party library
is that it requires a window handle upon initialization. So I create a pop
up window from inside the assembly using win32 to create the window. This
works great from testing within a form.

But the problem I run into is that when this plug in is loaded from the
seperate thread (which is a non UI thread), the window becomes non
responsive, and quits working. It won't even paint. After some testing I
found that it is because it was created on a non UI thread.

I was wondering is there a way to get access to the main ui thread to create
this window, or is there some other method I could use to create this pop
window on the main ui thread. Or possibly some other solution?

Thanks for any suggestions!
Jul 31 '08 #1
0 1192

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Christopher D. Wiederspan | last post: by
4 posts views Thread by Matthew Groch | last post: by
2 posts views Thread by none | last post: by
6 posts views Thread by Robert Speck | last post: by
2 posts views Thread by Mukesh | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.