Sure, I don't see why not -- just smuggle the winform thread id to your
unmanaged api somehow, and install a message filter
(Application.AddMessageFilter) on your winforms ui thread, to receive the
postbacks...  no big deal.

(Disclaimer: I've never actually tried this; maybe there's some catch in
winforms that fumbles thread-messages... I just make all this up, as I go
along!  Commit 2 minutes to try posting one to yourself, from C#, just to
make sure.)

-S


-----Original Message-----
From: tj [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 24, 2004 12:13
Subject: C++ native threads and .NET messaging

I have just joined this group and I have noticed a couple of messages about
threads and message pumps in the main gui.

What I need to know is how a C++ .NET gui can launch a C++ native worker
thread and the two communicate through the message pumps. The thread would
NOT be running via the CLR, but natively for effeciency.

In a C++ native the main gui would launch the thread with an
AfxBeginThread() call and then the gui would use PostThreadMessage() to send
messages to the thread and the thread would use PostMessage to send back to
the main gui. So can this same scenario be used with the main gui being C++
.NET under the CLR while the thread is non .NET and is native.

I have been led to believe that this is possible to do. Is it?

tj
[EMAIL PROTECTED]

===================================
This list is hosted by DevelopMentorR  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to