Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NET/Link Thread in C#

1 view
Skip to first unread message

Fabian

unread,
Oct 6, 2008, 4:15:09 AM10/6/08
to
Dear All-

Can anyone give me a hint on how to start C# threads from
Mathematica ?

I tried:
====
Needs["NETLink`"]
InstallNET[];

LoadNETType["System.Threading.Thread"]

myThread = NETNew[ThreadStart]

and I got:
=======
NETType["System.Threading.Thread", 8]
NETNew::args: Improper count or type of arguments. >>
$Failed

I also tried:
========
LoadNETType["System.Threading.Thread"]
t = NETNew[`Thread, Console`Out@WriteLine["Hello from .NET"] Start]

and I got:
======
NETType["System.Threading.Thread", 8]
NETNew::args: Improper count or type of arguments. >>
$Failed


I believe class ThreadStart needs to be instantiated before class
Thread, as the former is an argument of the latter's constructor.

Please help Thank you.

0 new messages