Passing Values Back From Threads

May 8, 2009

Can anyone give me the best method of passing back a value from a Thread?I have some procedures that I have set up as threads that I'm starting at the same time.My main function then waits until the threads are done and I'm needing to get back some values that the threads have created.Is there a better way to get these values back rather than just having them set a global variable with the returned value? Also, what is the proper way to wait for a thread to to be completed?I've just got a loop waiting for the Thread. Thread State property to not be in the Running state.So if there is a more proper way to wait for the thread to end I would be interested in knowing it.

View 7 Replies


ADVERTISEMENT

Passing Back Lisbox Values When Going Back To Previous Page?

Jul 23, 2009

I have a search page with a couple of pulldowns. Dependig on the values of them I show a grid matching the searched criteria, basically a table with links the user can navigate to. My problem comes when the user wants to navigate back. At the moment I have a "Back" button which simply redirects the user to the initial search page. I think it would be a good improvement to have the values of the pulldowns filled in with the values the user selected, this way when he presses the "Back" button he would not have to restart the whole search process again.

View 5 Replies

VS 2008 Passing Values Between Threads?

Oct 26, 2009

I am trying to get into vb.net but having an issue getting a variable value from a class library in a different thread.

What I am trying to do is create my own Winsock type control for my own use. Once data arrives I try and pass it back to the main application so that I can read it and process it.

So far I cant get it working at all. I have tried the following

Raiseevent

I try passing the value as a variable in the raiseevent property. This triggers an error about the value being in a different thread, I always thought that it would create a new variable in the thread of the application it was raising an event in and copy the value.

Function

I have tried writing a function into the class that I call (much like how the winsock control works) so that the class can return the value to the main application.

aka
strData = Myclass.GetData

in the class it returns the value and clears it from its own local variable. This however means the value returns to the main application as nothing even if I step through and see it assigning a value.

View 12 Replies

Passing An Amount Back To An Other Form?

May 25, 2009

I have a CheckingAccountForm and a CheckingAccount class. I have 2 variables AmountEntered and TotalAmount. The user enters an Amount and hits the calculate button. So now I send the AmountEntered to the CheckingAccount class where it is added to the TotalAmount and I have to send the TotalAmount back to the CheckingAccountForm so it can be displayed in a textbox. Can someone give me an example on how to do that? I get the AmountEntered to the CheckingAccount Class and managed to calculate, but not sure how to get the TotalAmount back so I can display it in the GUI's TextBox for the TotalAmount.

View 3 Replies

Passing A Large Text Back To The Server?

Nov 10, 2011

I have a project now where I will have a large chunk of CSV text, like 60 lines or more, and need to pass that from the client to the server. I know it would be weird with GET, but how would I store the multiline text so that I could later split it up, etc at my application?

View 2 Replies

Passing Data From A Form Back To A Thread

Sep 20, 2010

In a threadpooling situation is it possible for a modal form to be opened and data from that form to be passed back to the thread that opened it ?

View 1 Replies

Asp.net Mvc - Passing Record Id Into View And Then Getting Back On Form Post

Dec 9, 2011

MVC 3. VB.NET application.. I am trying to pass a id along to keep track of which record a file name needs to be saved in.. The problem is that the id is getting passed into the view but on post back to the controller it is being lost...I have hammered on this for hours now and I am stuck...

[Code]...

View 1 Replies

Multi Forms And Passing A Value From One Form Back To Another Using A Listbox

Apr 12, 2011

Im having trouble passing a value from one form back to another using a listbox... The user clicks a button in the main form to bring up an instance of another form (form2.show). In that form, the user then then selects a number 1-5 and then presses done:

[Code]...

View 2 Replies

Passing Array Form C++ DLL To VB6 Through Call Back Function?

Sep 6, 2005

I need to pass an uint8 array from C++ DLL to VB6 application but I receive always following error: "subscript out of range" if I try to work with the array 'pabyData' in my VB6 procedure. The C procedure is: typedef void (__stdcall *FUNCPTR2SendData) (const uint8_t* pabyData, uint16_t wDataLength); void SendData(const uint8_t* pabyData, uint16_twDataLength) { FUNCPTR2SendData vbFunc; vbFunc = (FUNCPTR2SendData) ptCBFPointers->p2NewDirectDataSMSEvnt; // ptCBFPointers are call back pointers, where is saved the call back address of VB6 functions vbFunc(pabyData, wDataLength); } The VB6 procedure is: Public Sub SendData(ByRef pabyData() As Byte, ByVal wDataLength As Integer

View 2 Replies

VS 2008 Login Popup Not Passing Back To Webrowser Form

Nov 23, 2010

I have created an application that I am using the VB webrowser control. The users needs to login to a site to display a particular webpage. The sites login is in a popup and what appears to be happening is the popup is launching outside my application (has IE in the title). If I enter uers/pass and try to login the information is not being passed back to my webrowser form.

View 5 Replies

Getting Back Values From A Function?

Feb 17, 2009

I know that if you declare a function as a data type you can return a value, but my question is, is there a way to get back other values from a function without declaring it as an arraylist? For example, if you made a GetValues function, is there a way to get a value by using something like GetValues.A or GetValuesB?

View 3 Replies

Hit The Submit Button The Values All Go Back To 0?

Dec 12, 2011

Using the following code, every time I hit the submit button the values all go back to 0

If txtBedrooms.Text = String.Empty Then
MessageBox.Show("Please enter a bedroom 0 or greater")
Exit Sub
ElseIf Not IsNumeric(txtBedrooms.Text) Then
MessageBox.Show("Please enter a bedroom 0 or greater")

[Code]...

View 2 Replies

Pass Values Back And Forth Appdomains?

Aug 9, 2009

I have the following [code]...

I thought make this would make my ada.myString have "working!" on the main appdomain, but it doesn't. I thought that by inhering from MarshalByRefObject any changes made on the 2nd appdomain would reflect also in the original one(I thought this would be just a proxy to the real object on the main appdomain!)?

View 2 Replies

Asp.net - Passing Values Between Web Forms?

May 1, 2011

Im trying to pass a value of a date control from form1 to form2.on form 1.aspx.vb:

Public ReadOnly Property Property1() As Date
Get
Return StartDate.SelectedDate[code].....

Tried to assign the property to a string, it did not work either.

View 2 Replies

ASP.net Form Not Passing Ddl Values

Dec 9, 2011

I have a form with 2 dropdownlists and a submit button. I want to pass the values of the lists in a URL when the list is submitted but for some reason the initial value of the ddl is getting passed. Here's my code:

[Code]...

View 2 Replies

Passing Values Between Forms

May 27, 2009

I think I'm getting hung up on syntax here. I've got 2 forms and am trying to pass a textbox value from the 1st form to the 2nd. The textbox value is an unique ID #, so it's an integer value in the database. The ID displays in the textbox just fine on the 1st form. When I try to access the value of this ID textbox in code in the 2nd form, I see that the value is empty, or equal to "". But I see a valid ID # on the 1st form. Here's the code that shows me that the textbox equals "".

[Code]...

View 2 Replies

Passing Values Between Forms In VB?

Jun 4, 2012

solid rundown of how this process works using custom events &EventArgs, Im really having trouble wrapping my head around it

View 14 Replies

Passing Values From One Form To Another?

Jun 22, 2010

i have a listview control on form1. I want to send the selected value to form2.

I tried couple of ways but nothing seems to work correctly.

View 6 Replies

Passing Values To Java?

May 10, 2009

I'm pulling up a a webpage in a control and the page is full of Java functions. I'm able to use execute a function using invokescript. That works out really well. But here's the thing. There's a function that takes the value of a rendered textbox and uses that data to perform the function.The textbox is usually hidden until another function activates it to enter data.What I want to do is to bypass having the textbox come up and execute the function with predefined data. Basically the function refers to the data it gets as txtWrapupComment.value whereas txtWrapupComment is the textbox it's getting its data from.

So, the bottom line, is there a way I can declare txtWrapupComment.value and pass it before I execute the funtion?

View 9 Replies

VS 2008 Passing Values?

May 22, 2009

basically, i get "Object reference not set to an instance of an object" on the line:

example Dim x As Integer = objPlayer.Hand.Count

this line is in the object Dealer, but as far as i can tell i've declared everything correctly ...

i was told that i had to pass the values to the object or something, but not how to do it

View 18 Replies

Multithreading - .NET 4.0 Execute Multiple Threads But Threads Are Completed Before Resuming?

Oct 19, 2011

I just had a new, last-minute idea on to take on a task, so I am running to StackExchange for quick help.

What I want to do is execute a series of methods right in a row, each in their own threads. I want the application to wait until all of these threads are completed, after which the program will resume. It also has to use managed threading (thread pool).

What quick examples could you provide to help me along the way? If it's too complex, what things should I know about so that I can Google it on my own?

View 1 Replies

Queue Threads - Spawn A Series Of 'child' Threads From A Loop

Dec 30, 2009

I have a main thread which is designed to be a batch processor - it spawns a series of 'child' threads from a loop (which can vary in terms of the no of items) - see below

[Code]...

However, each of the 'child' threads could take anywhere from milliseconds to about a minute to process - depending on the complexity of each calculation. There may also be a large number of child threads - e.g 100s. Creating large numbers of child threads is not efficient. I therefore want some way to effectively queue each child thread (and cancel if the process is taking too long to complete). Autoevents seems like one way of doing this, but the only examples I can find seem to assume there are two different processes on seperate threads, not one process being repeated.

View 4 Replies

Get Distinct Values And Converting Back Into DataTable?

Mar 14, 2012

I have a "result" which is DataTable and I like to get the x distinct values(City) and convert it back to DataTable how do I do this the code below gives me an error

Dim query = (From x In results.AsEnumerable()
Select (x.Field(Of String)("City"))).Distinct().CopyToDataTable()

so what I want is records of distinct cities I can get that but the problem I am having is converting it back to Datable.

Edited:I am using "where" in this statement and it does convert to Table(works fine) but not on "select"

Dim results = (From myRow In ds.Tables(1).AsEnumerable()
Where (myRow.Field(Of String)("xxxx") = xxxx)
Select myRow).Distinct().CopyToDataTable()

View 1 Replies

How To Use String Array For Passing Values

Oct 21, 2011

I have a simple query but I am just not able to get it right. Have a look at my sample code below:

Sub Function1
My Code Here
Function2(Year,Month)
End Sub
Sub Function2(Year,Month)
Dim Str as String()
for 1 to 30
Dim MyDate As New Date(Year, Month, i)
Str = MyDate.DayOfWeek.ToString()
Next
Return Str
End Sub

View 7 Replies

Passing Input Box Values To A Sql Database?

Feb 23, 2011

I have an input box that allows users to enter a date that when the user clicks "Ok" that it does two things, marks a field called "code" in my Exceptions SQL table as H and passes whatever date they have entered to that table as well.

View 1 Replies

Passing Values (integer) Between Forms?

May 1, 2012

My problem is that I have two forms, Form1 and Form2 ...on Form1 there is a TextBox called txtTotal (this contains the calculation of Ticket Prices, thus it's a numeric value) and on Form2 there is a TextBox called txtTotal2. All I want to do is get the same number that appears in txtTotal on Form1 to appear in txtTotal2 on Form2 .However whenever I try some of the help tips online such as using a declaring txtTotal as global or friend it dosn't work, and any other code iv tried attempts pass the textbox value as String which brings an error.

View 2 Replies

Passing Values From A List In Classes?

May 5, 2011

Im having a hard time trying to pass the values from a list inside of a class. Im trying to display multiple lines of values from a list inside of a class. My "client" class stores multiple lines of values into a list(of class transaction), with the number value(num) counting each transaction that it adds to the list.

Code:
Public Class Client
Private m_tranlist As New List(Of transaction)[code]....

im trying to display each line that is stored in the list in a label, and im having major trouble. I know all of the results are added into the lists, but how do i call the list in my main form in order to display each line of all of the values? Would I have to look up an index or something?

View 1 Replies

Passing Values From A VB App To A Stored Procedure?

Jan 6, 2011

This may not be the place to ask this, if not, you can move this post to the SQL forum but I have an application that I'm building which pulls dates from a database. The start value is stored as payPeriodStart date and I add 7 days to get the end date. What I need to know is, is it possible to store those values and pass them to a Stored Procedure? Currently my stored procedures have "static" dates in them ie:

where dateadd (n, Timestamp, '12/31/1899') - ([LoggedIn]/1000)/60/1440+1 Between '10/3/2010' and '10/10/2010'

and I'd like those values to be

Between payPeriodStartDate and payPeriodEndDate.

View 5 Replies

Passing Values Into Event Handler?

Feb 3, 2010

How do you pass values using a basic event handler:
'...
dropDownItem= New ToolStripMenuItem("item1", Nothing, New EventHandler(AddressOf clickHandler(1)))
'...
Public Sub clickHandler(ByVal sender As Object, ByVal e As System.EventArgs)
'dim i as integer = e
end sub

View 2 Replies

Passing Values To A Stored Procedure

Jan 6, 2011

I have an application that I'm building which pulls dates from a database. The start value is stored as payPeriodStart date and I add 7 days to get the end date. What I need to know is, is it possible to store those values and pass them to a Stored Procedure? Currently my stored procedures have "static" dates in them ie:

[Code]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved