Click here to Skip to main content
15,889,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: ado connection to access mdb file. Pin
paas13-Mar-09 6:11
paas13-Mar-09 6:11 
GeneralRe: ado connection to access mdb file. Pin
udikantz13-Mar-09 7:02
udikantz13-Mar-09 7:02 
GeneralRe: ado connection to access mdb file. Pin
udikantz13-Mar-09 23:07
udikantz13-Mar-09 23:07 
AnswerRe: ado connection to access mdb file. Pin
udikantz13-Mar-09 23:32
udikantz13-Mar-09 23:32 
QuestionAccessing Value from 2 class. Pin
Nanda_MR13-Mar-09 2:34
Nanda_MR13-Mar-09 2:34 
AnswerRe: Accessing Value from 2 class. Pin
dan!sh 13-Mar-09 2:42
professional dan!sh 13-Mar-09 2:42 
GeneralRe: Accessing Value from 2 class. Pin
Nanda_MR13-Mar-09 18:08
Nanda_MR13-Mar-09 18:08 
Questionvb.net 3.5 + serialport cotnrol + Threads = help Pin
ktheos13-Mar-09 2:23
ktheos13-Mar-09 2:23 
hello to everyone,
im new in .NET programming -and in multithreading- so if the answer of my question is to read more of multithreading just say it Smile | :)

i try to make an application to communicate with a device through serial port, after a lot of reading i made it to communicate in a way i want, but..... now the problem, when i use a second form, and at this form i create a thread and through that thread i try to send a data through com i get an error that com port is closed!
i try the .isAlive and in that thread the serial port looked closed.
To be more specific

IN form1 i use

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
        SerialPort1.Open()

    End Sub



IN form2 i use

Imports System.Threading

Public Class Form2

    Dim thr As Thread

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Debug.Print(Form1.SerialPort1.IsOpen)
        thr = New Thread(AddressOf thrsub)
        thr.IsBackground = True
        thr.Start()

    End Sub



    Public Sub thrsub()
        Debug.Print(Form1.SerialPort1.IsOpen)
    End Sub


End Class


at the first Debug.Print(Form1.SerialPort1.IsOpen) if the Button1_click it gives TRUE but in the second Debug.Print(Form1.SerialPort1.IsOpen) in the thrsub it gives FALSE.... Sigh | :sigh:

any suggestions?
AnswerRe: vb.net 3.5 + serialport cotnrol + Threads = help Pin
Bharat Jain13-Mar-09 3:19
Bharat Jain13-Mar-09 3:19 
AnswerRe: vb.net 3.5 + serialport cotnrol + Threads = help Pin
Dave Kreskowiak13-Mar-09 4:51
mveDave Kreskowiak13-Mar-09 4:51 
QuestionHow to set text property of a ComponentControl Pin
popalzai13-Mar-09 1:16
popalzai13-Mar-09 1:16 
AnswerRe: How to set text property of a ComponentControl Pin
Dave Kreskowiak13-Mar-09 1:18
mveDave Kreskowiak13-Mar-09 1:18 
GeneralRe: How to set text property of a ComponentControl Pin
popalzai13-Mar-09 3:45
popalzai13-Mar-09 3:45 
GeneralRe: How to set text property of a ComponentControl Pin
Dave Kreskowiak13-Mar-09 4:45
mveDave Kreskowiak13-Mar-09 4:45 
GeneralRe: How to set text property of a ComponentControl Pin
popalzai13-Mar-09 6:02
popalzai13-Mar-09 6:02 
Questionhow to insert multi image in SQL an display it Pin
ngoctuan160812-Mar-09 23:52
ngoctuan160812-Mar-09 23:52 
AnswerRe: how to insert multi image in SQL an display it Pin
Dave Kreskowiak13-Mar-09 1:17
mveDave Kreskowiak13-Mar-09 1:17 
QuestionGet a string of number ? Pin
dec8212-Mar-09 23:49
dec8212-Mar-09 23:49 
AnswerRe: Get a string of number ? Pin
Anoop Brijmohun13-Mar-09 0:47
Anoop Brijmohun13-Mar-09 0:47 
GeneralRe: Get a string of number ? Pin
Dave Kreskowiak13-Mar-09 1:16
mveDave Kreskowiak13-Mar-09 1:16 
GeneralRe: Get a string of number ? Pin
dec8213-Mar-09 2:59
dec8213-Mar-09 2:59 
AnswerRe: Get a string of number ? Pin
Eddy Vluggen13-Mar-09 0:51
professionalEddy Vluggen13-Mar-09 0:51 
AnswerRe: Get a string of number ? Pin
Jon_Boy13-Mar-09 3:39
Jon_Boy13-Mar-09 3:39 
GeneralRe: Get a string of number ? Pin
dec8213-Mar-09 5:59
dec8213-Mar-09 5:59 
GeneralRe: Get a string of number ? Pin
Luc Pattyn13-Mar-09 6:39
sitebuilderLuc Pattyn13-Mar-09 6:39 

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.