Click here to Skip to main content
15,898,942 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: update .net compact framework Pin
Fouad_kayali15-Aug-07 4:02
Fouad_kayali15-Aug-07 4:02 
GeneralRe: update .net compact framework Pin
Justin Perez15-Aug-07 4:07
Justin Perez15-Aug-07 4:07 
QuestionConnecting to Web Service.. Pin
moomoooomoo14-Aug-07 23:27
moomoooomoo14-Aug-07 23:27 
QuestionWIFI connection Pin
moomoooomoo14-Aug-07 23:16
moomoooomoo14-Aug-07 23:16 
QuestionHow to get Stylus Pointer (x,y) position on the Tree View Control. Pin
arunstar13-Aug-07 21:54
arunstar13-Aug-07 21:54 
AnswerRe: How to get Stylus Pointer (x,y) position on the Tree View Control. Pin
AgentBignose8-Oct-09 4:17
AgentBignose8-Oct-09 4:17 
QuestionCalling a Webbrowser control again. Pin
arunstar13-Aug-07 19:22
arunstar13-Aug-07 19:22 
QuestionThreading.Monitor.Exit(x) throws ArgumentException... any ideas why? Pin
jchesney13-Aug-07 9:29
jchesney13-Aug-07 9:29 
Hi All!

I have simple application running under Windows CE 4.2, using compact framework 1.0 SP3.

There are two timers (threads) operating in the program which read/manipulate a common variable of type integer. To prevent critical section collisions I am using the Threading.Monitor.Enter / Exit methods to acquire and release a lock on the variable in question.

The Enter method call works. The Exit method call throws an exception, and I don't know why.

Here is a sample chunk of code.
<br />
Public Class FormMain<br />
    Inherits System.Windows.Forms.Form<br />
#Region " Windows Form Designer generated code "<br />
<br />
    Public Sub New()<br />
<br />
        MyBase.New()<br />
<br />
        'This call is required by the Windows Form Designer.<br />
        InitializeComponent()<br />
<br />
        'Add any initialization after the InitializeComponent() call<br />
<br />
    End Sub<br />
<br />
    'Form overrides dispose to clean up the component list.<br />
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)<br />
        MyBase.Dispose(disposing)<br />
    End Sub<br />
<br />
    'NOTE: The following procedure is required by the Windows Form Designer<br />
    'It can be modified using the Windows Form Designer.  <br />
    'Do not modify it using the code editor.<br />
    Friend WithEvents inputTimer As System.Windows.Forms.Timer<br />
    Friend WithEvents outputTimer As System.Windows.Forms.Timer<br />
<br />
    Private Sub InitializeComponent()<br />
        Me.inputTimer = New System.Windows.Forms.Timer<br />
        Me.outputTimer = New System.Windows.Forms.Timer<br />
        '<br />
        'inputTimer<br />
        '<br />
        Me.inputTimer.Enabled = True<br />
        '<br />
        'outputTimer<br />
        '<br />
        Me.outputTimer.Enabled = True<br />
        Me.outputTimer.Interval = 500<br />
<br />
        Me.Text = "Threads"<br />
<br />
    End Sub<br />
<br />
    Public Shared Sub Main()<br />
        Application.Run(New FormMain)<br />
    End Sub<br />
<br />
#End Region<br />
<br />
    Private _inputs As Integer = 0<br />
<br />
    Private Sub inputTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles inputTimer.Tick<br />
        Try<br />
            Threading.Monitor.Enter(_inputs)<br />
<br />
            _inputs += 1<br />
<br />
            Threading.Monitor.Exit(_inputs)<br />
        Catch ex As Exception<br />
            MsgBox(ex.Message)<br />
        End Try<br />
    End Sub<br />
<br />
    Private Sub outputTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles outputTimer.Tick<br />
        Try<br />
            Threading.Monitor.Enter(_inputs)<br />
<br />
            _inputs = 0<br />
<br />
            Threading.Monitor.Exit(_inputs)<br />
        Catch ex As Exception<br />
            MsgBox(ex.Message)<br />
        End Try<br />
    End Sub<br />
End Class<br />


So if you can tell me what I am doing wrong in the .Net Compact Framework, I would appreciate it.

Thanks,

j.
QuestionDataGrid Pin
Sunshine Always13-Aug-07 1:04
Sunshine Always13-Aug-07 1:04 
QuestionWhere are some .Net compact framework classes?? Pin
PremierITA12-Aug-07 1:15
PremierITA12-Aug-07 1:15 
QuestionAbout C# ListView ItemClick or DoubleClick or Click Pin
WOAIXYEYANLI11-Aug-07 18:25
WOAIXYEYANLI11-Aug-07 18:25 
Questiongprs connection Pin
ahzarmokhli8-Aug-07 20:01
ahzarmokhli8-Aug-07 20:01 
AnswerRe: gprs connection Pin
Daniel Strigl8-Aug-07 20:39
Daniel Strigl8-Aug-07 20:39 
GeneralRe: gprs connection Pin
ahzarmokhli8-Aug-07 20:47
ahzarmokhli8-Aug-07 20:47 
GeneralRe: gprs connection Pin
Daniel Strigl8-Aug-07 21:01
Daniel Strigl8-Aug-07 21:01 
GeneralRe: gprs connection [modified] Pin
ahzarmokhli19-Aug-07 21:27
ahzarmokhli19-Aug-07 21:27 
Questiondefine own file type Pin
ahzarmokhli8-Aug-07 18:04
ahzarmokhli8-Aug-07 18:04 
AnswerRe: define own file type Pin
Daniel Strigl8-Aug-07 20:41
Daniel Strigl8-Aug-07 20:41 
QuestionHow to delete/make invisible columns in a datagrid [modified] Pin
kudorgyozo8-Aug-07 0:35
kudorgyozo8-Aug-07 0:35 
QuestionEVC++ 4.0 serial up Pin
mercenary017-Aug-07 22:42
mercenary017-Aug-07 22:42 
QuestionPanel.VisibleChanged in .NET CF Pin
haslingd7-Aug-07 22:31
haslingd7-Aug-07 22:31 
QuestionMouse tracking in WM5 Pin
2hdass7-Aug-07 8:59
2hdass7-Aug-07 8:59 
QuestionIpaq 3970 Latest OS? Pin
Malcolm Smart7-Aug-07 8:34
Malcolm Smart7-Aug-07 8:34 
GeneralRe: Ipaq 3970 Latest OS? Pin
Malcolm Smart7-Aug-07 8:36
Malcolm Smart7-Aug-07 8:36 
QuestionIrDA programming in WM5 Pin
orenmh7-Aug-07 2:11
orenmh7-Aug-07 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.