First of all, threading and interoperability are really independent issues. Whether a thread is running code written in C or code written in C# does not matter as far as the notification of the C# GUI is concerned. Both should use a callback/event mechanism.
You can pass a callback to unmanaged code through PInvoke and then the C code can call that code by simply invoking it as a function pointer. Data can also be shared via PInvoke. Many primitive and built-in datatypes do not require a lot of tweaking to be easily usable through PInvoke. I would recommend Nathan's book on .NET COM Interoperability for a very complete treatment of these issues. Regards, Alex --+-----------------------------------+ | Alexander R Krapf, Codemesh, Inc. | | | | Address: P.O.Box 620 | | Carlisle, MA 01741 | | USA | | E-mail: [EMAIL PROTECTED] | | Web: http://www.codemesh.com | | Phone: +1 (978) 369-8583 | | Fax: +1 (978) 369-9088 | +-----------------------------------+ >> 1: How does the C code in a thread communicate to objects in >> C# code? >> Example: C# GUI code will have a VU meter object to display >> "incoming audio signal strength". The value for is obtained by the >> thread by averaging the incoming audio. The C/C++ thread must now tell >> the GUI object to display it. How is this done in C to communicate with >> a C# object? >> If this were a straight C/C++ application, you would simply call >> the objects set routine. >> 2: How does C# and a C thread share the same data structures? >> Example: Much of my setup data is pretty much static, it changes very >> little. Using variables like UserName, administratorName, etc. The C# >> gui would read this data from an init file into a data structure like >> the following psuedo code: =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: Guerrilla ASP.NET, 10 Nov 2003 in London and 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnet Guerrilla .NET, 8 Dec 2003, in Los Angeles http://www.develop.com/courses/gdotnet View archives and manage your subscription(s) at http://discuss.develop.com
