473,606 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Theading success (and a little gotcha lurking...)

I am so happy about this I had to tell someone and since no one at the
house even knows how to spell VB, I just had to make a short post.

I finally got my little program to correctly do a second thread for the
daily FTP upload. Not doing so was locking up the UI and causing it to
go white-screen. It is also not taking more than 60 seconds and the
timer was popping (yes, I know it is stoppable).

AND, I had to update a status (label) box and that took putting in the
second bit of code and there was a gotcha in there but I got it working,
finally. The update code was a little more complex than just blasting
the text in the box. It queues up messages if one was already showing
and put in a notice to click for more messages. Too cute!

Here's the gotcha in the thread-side UI update of the label text.

I had several forms and a module (quite standard). I put the code in
the module to accept the text destined for the label and called it with
the proper use of a delegate. It did not work. Why? Don't know but
the connection did not work when using the following (not sure which one
failed but I think it was the first line):

formname.lblSta tus.InvokeRequi red
Dim newDelegate As New UIDelegate(Addr essOf StatusAdd)
formname.lblSta tus.Invoke(newD elegate)

The following works in the label-owning form:

If lblStatus.Invok eRequired Then
Dim newDelegate As New UIDelegate(Addr essOf StatusAdd)
lblStatus.Invok e(newDelegate)
Else

Since the routine was called from more than one form, it was natural to
have it in the module but it just did not work there. It seems the
routine and test has to be in the form which owns the label. So I moved
the routine to the owning module and prefaced the calls to it from the
other form(s) with the form name. Don't ask me! I know it cost some
time because I did not know where the problem really was.

HOORAY!!!

Silly note. I had the "chance" to go back to the VB6 IDE the other day.
I am amazed at how FAST I have gotten used to using the new IDE and how
clunky the VB6 one feels now. With all its problems, it is still
better. Now, if FIND would just FIND inside visually collapsed code...
Why the designers thought that you would not want to find stuff because
you were saving screen space is a continuing mystery!

Mike

Jun 27 '08 #1
0 973

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

Similar topics

303
17551
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
32
1766
by: Lyle Fairfield | last post by:
1. Will your next operating system be Windows? 2. Will your next browser be Internet Explorer? 3. Will your next office suite be MS Office XXXX? 4. Will your next e-mail client be Outlook or Outlook Express? 5. Will your next database server be MS-SQL?
2
1168
by: Guadala Harry | last post by:
I'm dynamically building an HTML <table> that has a bunch of rows - each of which presents read-only data in DIVs. Just wondering if it's okay to omit both the Name and Id attribute of the DIV tags in the table - or if there is some good reason why I should go to the effort to create a unique Name or Id value for each (which would also increase processing time and render more verbose html). Given that I have no client- nor server-side...
43
3351
by: Tim Chase | last post by:
Just as a pedantic exercise to try and understand Python a bit better, I decided to try to make a generator or class that would allow me to unpack an arbitrary number of calculatible values. In this case, just zeros (though I just to prove whatever ends up working, having a counting generator would be nice). The target syntax would be something like >>> a,b,c = zeros() >>> q,r,s,t,u,v = zeros()
0
8016
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
7955
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
8440
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
8431
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8306
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5966
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
5466
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
2448
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
0
1300
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.