943,917 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 664
  • VB.NET RSS
Nov 20th, 2008
0

Pocket PC applcation-Vb.net error

Expand Post »
Hi All

I am getting this error message when i run my pocket pc application using active sync on my PDA. i get this message when I am using threading in my application otherwise the code works but application crashes when i am trying to access the menus while the main loop is running. Any ideas would be much appreciated.

Many Thanks

ERROR

System.NotSupportedException was unhandled
Message="An error message cannot be displayed because an optional resource assembly containing it cannot be found"
StackTrace:
at Microsoft.AGL.Common.MISC.HandleAr()
at System.Windows.Forms.Control.get_Text()
at DeviceApplication1.Form1.rsvp()


My code is as following
Imports System.IO
Imports System
Imports System.Threading
Imports System.Windows.Forms


Public Class Form1
Public Sub rsvp()
Dim readcontents As String = TextBox1.Text

Dim textdelimiter As String

textdelimiter = (" ")
Dim splitout() As String = Split(readcontents, textdelimiter)
Dim i As Integer
For i = 0 To UBound(splitout)


Label1.Text = splitout(i)

Label1.Refresh()


System.Threading.Thread.Sleep(200)
Next
End Sub
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Dim dlg As OpenFileDialog = New OpenFileDialog()
dlg.Filter = "txt files (*.txt)|*.txt"
'dlg.ShowDialog()
'
If dlg.ShowDialog = Windows.Forms.DialogResult.OK Then

Dim filestream As StreamReader = New StreamReader(dlg.FileName)


Dim readcontents As String
readcontents = filestream.ReadToEnd()
TextBox1.Text = readcontents



filestream.Close()


End If
End Sub




Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
Dim value As Boolean = False
'Control.CheckForIllegalCrossThreadCalls = value

Dim t As Thread

t = New Thread(AddressOf rsvp)
t.Start()

End Sub
End Class
Reputation Points: 10
Solved Threads: 0
Newbie Poster
harrybern is offline Offline
6 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: How to Insert Picture to SQL Database
Next Thread in VB.NET Forum Timeline: printing the jpg file using vb.net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC