473,804 Members | 3,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Multi-threading

Hi,

I am designing an interface which allows users to load certain files
into the interface. While the file is loading, I want to display a
VB.NET form with the list of messages generated during the process. I
want the form to be displayed during the loading process and the
messages to appear one after another as they are generated in the
back-end. I'm pretty sure I need to use multi-threading for this but
I am having a lot of trouble figuring out how to do it.

I think part of my problem might be that the function which displays
the form and adds the messages to the form gets called on an
as-needed-basis instead of in a step-by-step process.

Does anyone have any advice or ideas on how I can approach this
problem??

Thanks!!

Joy
Nov 21 '05 #1
3 2039
If this is a windows application you can just create a splash screen that
has a status bar that you change. The splach screen loads all the objects
and then shows the main form. It would be best to do this inside a main
method in a seperate class.

<STAThread()> _

Shared Sub Main()

Dim frm As New frmMain

Dim frmSplash As New SplashScreen

frmSplash.Show( )

frm.LoadMemory( True, frmSplash.Statu sBar1)

frm.LoadLocatio nData(frmSplash .StatusBar1)

frm.LoadWellMob ileData(frmSpla sh.StatusBar1)

frm.LoadCallShe etData(frmSplas h.StatusBar1)

frm.LoadForm(fr m)

frmSplash.Close ()

' Call the Application class' Run method

' passing it the Form1 object created above.

Application.Run (frm)

End Sub
<si***********@ yahoo.com> wrote in message
news:1d******** *************** ***@posting.goo gle.com...
Hi,

I am designing an interface which allows users to load certain files
into the interface. While the file is loading, I want to display a
VB.NET form with the list of messages generated during the process. I
want the form to be displayed during the loading process and the
messages to appear one after another as they are generated in the
back-end. I'm pretty sure I need to use multi-threading for this but
I am having a lot of trouble figuring out how to do it.

I think part of my problem might be that the function which displays
the form and adds the messages to the form gets called on an
as-needed-basis instead of in a step-by-step process.

Does anyone have any advice or ideas on how I can approach this
problem??

Thanks!!

Joy

Nov 21 '05 #2
I'm not sure this is what you are talking about but I just did something
similar with uploading to an ftp site. Basically what I did is created a
progress form that had a status property and then had this in click of the
upload button
oProgress = new progress
oProgress.Statu s = "Connecting "
oProgress.Show
ftpThread = New System.threadin g.thread(addres sof UploadFTP)

then in my UploadFTP method I had this

oProgress.statu s = "Uploading File A"
'Upload file A
oProgress.statu s = "Uploading File B"
'Upload file B
oProgress.statu s = "Uploading File C"
'Upload file C
oProgress.statu s = "Uploading File D"
'Upload file D

This kept the program from looking like it was "Not Responding" and allowed
me to add a cancel button also.

<si***********@ yahoo.com> wrote in message
news:1d******** *************** ***@posting.goo gle.com...
Hi,

I am designing an interface which allows users to load certain files
into the interface. While the file is loading, I want to display a
VB.NET form with the list of messages generated during the process. I
want the form to be displayed during the loading process and the
messages to appear one after another as they are generated in the
back-end. I'm pretty sure I need to use multi-threading for this but
I am having a lot of trouble figuring out how to do it.

I think part of my problem might be that the function which displays
the form and adds the messages to the form gets called on an
as-needed-basis instead of in a step-by-step process.

Does anyone have any advice or ideas on how I can approach this
problem??

Thanks!!

Joy

Nov 21 '05 #3

Basically that is exactly what I am trying to do but the difference is
that I don't know what the status messages will be in advance. So I
can't create a function that says "write this, then write this, etc."
The messages are generated as I load the file - for that reason I have a
function that handles the event of a status message being generated. In
this function I take the message and place it in the form to display to
the user.

Is there anyway to make it so that the every time I place a message in
the form = 1 thread??

Thanks!

Joy
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2426
by: Marko Poutiainen | last post by:
Situation: We had to make our SQLServer 2000 database multi-lingual. That is, certain things (such as product names) in the database should be shown in the language the user is using (Finnish, Swedish or English). There are about a dozen tables with columns that need localization. Doing this in the application level was a no-goer. It would have taken far too much time (there is a *lot* of code and unfortunately most of the...
12
3884
by: * ProteanThread * | last post by:
but depends upon the clique: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=954drf%24oca%241%40agate.berkeley.edu&rnum=2&prev=/groups%3Fq%3D%2522cross%2Bposting%2Bversus%2Bmulti%2Bposting%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den ...
6
4625
by: radnoraj | last post by:
Hi, I am sucessfull in redirecting console output to a file. but in this case nothing is displayed on the console, cout output is written to file without display. how do write the output to console as well as to file, my code is as below, ======================================================================= #include <iostream.h> #include<ostream> #include<sstream>
2
3045
by: google | last post by:
Hello everyone, I am having an issue using the "Multi Select" option in a list box in MS Access 2003. I am making a form that users can fill out to add an issue to the database. Each issue can be associated with multiple categories. I have an "Issue," "IssueCategory," and "Category" in the database (among other tables). The form has a subform in it which is tied to the "IssueCategory" table. The main form is tied to the "Issue"...
8
14334
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does ifstream. Something I found shows that, I need to have a proper codecvt to set it. I need more information, maybe a small piece of code sample. Thank you!
5
3288
by: dkelly925 | last post by:
Is there a way to add an If Statement to the following code so if data in a field equals "x" it will launch one report and if it equals "y" it would open another report. Anyone know how to modify this? Private Sub cmdPreview_Click() On Error GoTo Err_Handler 'Purpose: Open the report filtered to the items selected in the list box. 'Author: Allen J Browne, 2004. http://allenbrowne.com Dim varItem As Variant 'Selected items
4
14284
by: Phoe6 | last post by:
Hi, I have a configfile, in fact, I am providing a configfile in the format: Name: Foo Author: Bar Testcases: tct123
1
9322
by: mknoll217 | last post by:
I am recieving this error from my code: The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "PAR.PAR_Status" could not be bound. The multi-part identifier "Salary.New_Salary" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part...
16
4371
by: Michael Brennan | last post by:
I guess this question only applies to programming applications for UNIX, Windows and similiar. If one develops something for an embedded system I can understand that wchar_t would be unnecessary. I wonder if there is any point in using char over wchar_t? I don't see much code using wchar_t when reading other people's code (but then I haven't really looked much) or when following this newsgroup. To me it sounds reasonable to make sure...
14
2977
by: raylopez99 | last post by:
KeyDown won't work KeyPress fails KeyDown not seen inspired by a poster here:http://tinyurl.com/62d97l I found some interesting stuff, which I reproduce below for newbies like me. The main reason you would want to do this is for example to trigger something from an OnPaint event without resorting to boolean switches-- say if a user presses the "M" key while the program is Painting, the user gets the PaintHandler to do something else. ...
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.