G
Guest
Hello
I'm having a problem running a C# multithreaded application on Windows CE 5.0.
The code I'm trying to execute is the source code of the MSDN article:
"Safe, Simple Multithreading in Windows Forms, Part 3" , January 2003,
written by Chris Sells
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms06112002.asp).
The source files consist of 'AsynchCalcPi.cs' and 'NineDigitsOfPiAt.cs'
found in
winforms01232003_sample\ch13\LongRunningOperations\.
(For VS2005 users: Start a new Windows CE project with Compact Framework 2.0
installed and do some copy and past to get it running).
The code demonstrates a thread safe 'message passing model', in which a long
running operation (the calculation of n digits of pi) is performed on a
worker thread.
Everything in the source code is supported by the .Net Compact Framework 2.0
so this code should run just as well on both Windows CE and Windows XP. At
least so I thought.
The problem is that the application executes just fine on Windows XP (thanks
to MSIL), but I'm not able to get it running on Windows CE 5.0. Strange,
isn't it?
What happens is that when i deploy the application from Visual Studio 2005
on the Windows CE target device, the application starts up by showing a form
in which you can type the number of decimals of pi you want to compute and a
button to start and cancel the computations.
When pressing the start button a worker thread is started from the thread
pool by calling BeginInvok and set to do the computations.
This is also where the application fails on Windows CE: When pressing the
start button a "NotSupportedException" is thrown and the Visual Studio 2005
debugger indicates that this is caused by
Application.Run(new AsynchCalcPiForm());
in the main method.
This I don't understand. The Windows Form is simpy launched from the default
'Program.cs' file containing only the main method with the above mentioned
statement.
What could be the problem here?
Why is this working on Windows XP but not Windows CE?
PS This question was posted under Mobile and Embedded
Development\Windows CE>Application Development but I was adviced to post
it here instead.
I'm having a problem running a C# multithreaded application on Windows CE 5.0.
The code I'm trying to execute is the source code of the MSDN article:
"Safe, Simple Multithreading in Windows Forms, Part 3" , January 2003,
written by Chris Sells
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms06112002.asp).
The source files consist of 'AsynchCalcPi.cs' and 'NineDigitsOfPiAt.cs'
found in
winforms01232003_sample\ch13\LongRunningOperations\.
(For VS2005 users: Start a new Windows CE project with Compact Framework 2.0
installed and do some copy and past to get it running).
The code demonstrates a thread safe 'message passing model', in which a long
running operation (the calculation of n digits of pi) is performed on a
worker thread.
Everything in the source code is supported by the .Net Compact Framework 2.0
so this code should run just as well on both Windows CE and Windows XP. At
least so I thought.
The problem is that the application executes just fine on Windows XP (thanks
to MSIL), but I'm not able to get it running on Windows CE 5.0. Strange,
isn't it?
What happens is that when i deploy the application from Visual Studio 2005
on the Windows CE target device, the application starts up by showing a form
in which you can type the number of decimals of pi you want to compute and a
button to start and cancel the computations.
When pressing the start button a worker thread is started from the thread
pool by calling BeginInvok and set to do the computations.
This is also where the application fails on Windows CE: When pressing the
start button a "NotSupportedException" is thrown and the Visual Studio 2005
debugger indicates that this is caused by
Application.Run(new AsynchCalcPiForm());
in the main method.
This I don't understand. The Windows Form is simpy launched from the default
'Program.cs' file containing only the main method with the above mentioned
statement.
What could be the problem here?
Why is this working on Windows XP but not Windows CE?
PS This question was posted under Mobile and Embedded
Development\Windows CE>Application Development but I was adviced to post
it here instead.