I could use a bit of help with the following question � Appreciate any and
all input (sic).



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:



stuct nodeInfoType{

    char   UserName[80];

    char   adminstratorName[80];

};



struct nodeInfoType nodeInfo;





Now, since the variable UserName would be application global in scope,
it could be accessed by both the main thread, the C# code in this case,
and any other thread running in the same code/data space, my C code in
this case.

But, it is my understanding, given my limited knowledge of C#, that data
is contained in classes and methods. And, since C does not know what
classes and methods are, how can variables be shared?


3: Then there is the question of locking mutexes that keep threads from
accessing the same varaible or critical code section at the same time.



How are these mutexes declared in C# that can also be used in a C code
thread?

I have never done any C# programming before and these questions
may have very simple answers, and I hope they do.





Any books that you may recommend in this area?



Thanks very much for your time�..

===================================
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

Reply via email to