Click here to Skip to main content
15,887,338 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Running project Pin
Henry Minute14-Jul-09 11:46
Henry Minute14-Jul-09 11:46 
GeneralRe: Running project Pin
KORCARI14-Jul-09 21:08
KORCARI14-Jul-09 21:08 
GeneralRe: Running project Pin
Dave Kreskowiak15-Jul-09 4:53
mveDave Kreskowiak15-Jul-09 4:53 
QuestionHandling Exceptions In Threads Pin
sohaib_a14-Jul-09 10:30
sohaib_a14-Jul-09 10:30 
AnswerRe: Handling Exceptions In Threads Pin
Luc Pattyn15-Jul-09 0:42
sitebuilderLuc Pattyn15-Jul-09 0:42 
GeneralRe: Handling Exceptions In Threads Pin
sohaib_a15-Jul-09 3:24
sohaib_a15-Jul-09 3:24 
GeneralRe: Handling Exceptions In Threads Pin
Luc Pattyn15-Jul-09 3:32
sitebuilderLuc Pattyn15-Jul-09 3:32 
AnswerRe: Handling Exceptions In Threads Pin
Gideon Engelberth15-Jul-09 3:16
Gideon Engelberth15-Jul-09 3:16 
Did you put the exception handler inside the method running on the thread or in the method that started the thread? In general, if an exception occurs on a background thread and that thread does not handle the exception, the thread dies and no notification is made to the main program.

Option A (do this)
Private Sub ThreadRunMethod()
   Try
      'your code here that throws an exception
   Catch ex as Exception
      'something that handles the exception, but 
      'does not modify the UI directly.
   End Try
End Sub

Private Sub OtherMethod()
   Dim myThread as New Thread(AddressOf ThreadRunMethod)
   myThread.Start()
End Sub


Option B (don't do this, the start method will return right away)
Private Sub ThreadRunMethod()
  'your code here that throws an exception
End Sub

Private Sub OtherMethod()
   Dim myThread as New Thread(AddressOf ThreadRunMethod)
   Try
       myThread.Start()
   Catch ex As Exception
       'handle exception from thread method
   End Try
End Sub

GeneralRe: Handling Exceptions In Threads Pin
sohaib_a15-Jul-09 4:04
sohaib_a15-Jul-09 4:04 
QuestionTrouble with COM-Class for Outlook Pin
Sonhospa14-Jul-09 8:16
Sonhospa14-Jul-09 8:16 
AnswerRe: Trouble with COM-Class for Outlook Pin
Sonhospa14-Jul-09 9:06
Sonhospa14-Jul-09 9:06 
QuestionHelp Creating Exe File[modified] Pin
Kaushal Arora14-Jul-09 6:52
Kaushal Arora14-Jul-09 6:52 
AnswerRe: Help Pin
Steven J Jowett14-Jul-09 7:47
Steven J Jowett14-Jul-09 7:47 
QuestionAdd tables to existing SQL database Pin
Nielvh14-Jul-09 1:38
Nielvh14-Jul-09 1:38 
AnswerRe: Add tables to existing SQL database Pin
helelark12314-Jul-09 1:47
helelark12314-Jul-09 1:47 
GeneralRe: Add tables to existing SQL database Pin
Nielvh14-Jul-09 1:55
Nielvh14-Jul-09 1:55 
GeneralRe: Add tables to existing SQL database Pin
helelark12314-Jul-09 2:09
helelark12314-Jul-09 2:09 
GeneralRe: Add tables to existing SQL database Pin
Nielvh14-Jul-09 2:17
Nielvh14-Jul-09 2:17 
Questionrun access query for crystal report Pin
KIDYA13-Jul-09 23:26
KIDYA13-Jul-09 23:26 
AnswerRe: run access query for crystal report Pin
helelark12313-Jul-09 23:37
helelark12313-Jul-09 23:37 
GeneralRe: run access query for crystal report Pin
KIDYA14-Jul-09 0:39
KIDYA14-Jul-09 0:39 
QuestionData Conversion Error at RecordSet.MoveNext VB6 Pin
she-Developer13-Jul-09 22:19
she-Developer13-Jul-09 22:19 
AnswerRe: Data Conversion Error at RecordSet.MoveNext VB6 Pin
helelark12313-Jul-09 22:27
helelark12313-Jul-09 22:27 
QuestionWindows Popup Watcher Pin
jeipiyaku13-Jul-09 22:09
jeipiyaku13-Jul-09 22:09 
AnswerRe: Windows Popup Watcher Pin
jeipiyaku13-Jul-09 22:16
jeipiyaku13-Jul-09 22:16 

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.