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

Visual Basic

 
GeneralRe: [VB6] How can i measure a volume of the sound entering the microphone of my computer. Pin
Dave Kreskowiak17-Jun-09 18:04
mveDave Kreskowiak17-Jun-09 18:04 
GeneralRe: [VB6] How can i measure a volume of the sound entering the microphone of my computer. Pin
cavemen17-Jun-09 18:12
cavemen17-Jun-09 18:12 
GeneralRe: [VB6] How can i measure a volume of the sound entering the microphone of my computer. Pin
Johan Hakkesteegt17-Jun-09 20:11
Johan Hakkesteegt17-Jun-09 20:11 
GeneralRe: [VB6] How can i measure a volume of the sound entering the microphone of my computer. Pin
molesworth17-Jun-09 23:02
molesworth17-Jun-09 23:02 
GeneralRe: [VB6] How can i measure a volume of the sound entering the microphone of my computer. Pin
Johan Hakkesteegt18-Jun-09 1:37
Johan Hakkesteegt18-Jun-09 1:37 
QuestionProblem in thread (VB.Net 2005) Pin
priyamtheone17-Jun-09 5:17
priyamtheone17-Jun-09 5:17 
AnswerRe: Problem in thread (VB.Net 2005) Pin
nlarson1117-Jun-09 6:14
nlarson1117-Jun-09 6:14 
GeneralRe: Problem in thread (VB.Net 2005) Pin
priyamtheone23-Jun-09 3:10
priyamtheone23-Jun-09 3:10 
nlarson11 wrote:
i think there's other options but i'll give you want you ask for.

you would need to start a second message loop. so in the routine that's called when you start the new thread. do an application.run(your main form) in there. then close your startup form and the first message loop will killed.


Hi nlarson11, I did it ur way. It works great. But i tried to change it a bit. Here's my code:

Imports System.Threading

Public Class frmStartup

    Private Sub frmStartup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim OldThread As Thread
        Dim NewThread As Thread

        Try
            OldThread = Thread.CurrentThread
            NewThread = New Thread(AddressOf NewThreadMethod)
            NewThread.Start()
            OldThread.Abort()
            'Me.Close()
	Catch tae as ThreadAbortException
	    'Do nothing.
        Catch ex As Exception
            MsgBox(ex.Message, , "frmStartup_Load")
        End Try
    End Sub

    Private Sub NewThreadMethod()
        Try
            Application.Run(New frmAnother)
        Catch ex As Exception
            MsgBox(ex.Message, , "NewThreadMethod")
        End Try
    End Sub

End Class


U told me to close the startup form after starting the new thread. When I do that everything is fine. But instead, as I tried to terminate the old thread explicitly, When I run it from the IDE it seems to be ok but when I execute the app by clicking the exe only, it throws ThreadAbortException though I'm catching it. The problem stays even if I uncomment Me.Close() and use it with OldThread.Abort(). So is it mandatory that I'm limited to close frmStartup only and can't terminate the old thread explicitly without the exception being thrown? Looking 4ward 4 ur further advice. Thanks 4 ur help.
AnswerRe: Problem in thread (VB.Net 2005) Pin
Dave Kreskowiak17-Jun-09 8:06
mveDave Kreskowiak17-Jun-09 8:06 
GeneralRe: Problem in thread (VB.Net 2005) Pin
priyamtheone22-Jun-09 5:58
priyamtheone22-Jun-09 5:58 
QuestionSMTP Mails - working in one computer not with other computer Pin
Paramu197317-Jun-09 4:58
Paramu197317-Jun-09 4:58 
AnswerRe: SMTP Mails - working in one computer not with other computer Pin
nlarson1117-Jun-09 6:21
nlarson1117-Jun-09 6:21 
GeneralRe: SMTP Mails - working in one computer not with other computer Pin
Paramu197317-Jun-09 19:16
Paramu197317-Jun-09 19:16 
GeneralRe: SMTP Mails - working in one computer not with other computer Pin
Rajesh Anuhya17-Jun-09 20:33
professionalRajesh Anuhya17-Jun-09 20:33 
QuestionUsing 'SetParent' function in VB 2008 Pin
Filippo197417-Jun-09 2:31
Filippo197417-Jun-09 2:31 
AnswerRe: Using 'SetParent' function in VB 2008 Pin
nlarson1117-Jun-09 3:33
nlarson1117-Jun-09 3:33 
GeneralRe: Using 'SetParent' function in VB 2008 Pin
Filippo197417-Jun-09 3:55
Filippo197417-Jun-09 3:55 
QuestionPropertyGrid image Selection while Property is ReadOnly Problem Pin
VB 8.017-Jun-09 2:04
VB 8.017-Jun-09 2:04 
QuestionIssue while creating tables in ms access using VB.NET ADOX [modified] Pin
sivakumar.mariappan17-Jun-09 0:32
sivakumar.mariappan17-Jun-09 0:32 
AnswerRe: Issue while creating tables in ms access using VB.NET ADOX Pin
Johan Hakkesteegt17-Jun-09 0:47
Johan Hakkesteegt17-Jun-09 0:47 
GeneralRe: Issue while creating tables in ms access using VB.NET ADOX Pin
sivakumar.mariappan17-Jun-09 1:15
sivakumar.mariappan17-Jun-09 1:15 
AnswerRe: Issue while creating tables in ms access using VB.NET ADOX Pin
Ashfield17-Jun-09 1:25
Ashfield17-Jun-09 1:25 
GeneralRe: Issue while creating tables in ms access using VB.NET ADOX Pin
sivakumar.mariappan17-Jun-09 3:49
sivakumar.mariappan17-Jun-09 3:49 
GeneralRe: Issue while creating tables in ms access using VB.NET ADOX Pin
Ashfield17-Jun-09 8:57
Ashfield17-Jun-09 8:57 
QuestionRead the Excel upto used range Pin
Member 402761716-Jun-09 21:36
Member 402761716-Jun-09 21:36 

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.