Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

updating form...

Posted on 2000-02-16
8
Medium Priority
?
138 Views
Last Modified: 2010-05-02
I made a application which deals with a gsm-modem. It receives and sends messages through that modem. I'm also showing all the time in my form how many messages are in a buffer not yet to send. There is also 20 spots in gms-modems memory where it can store the coming messages. My form also shows which places have messages and which don't have (red and green lights).

My problem is that when I'm receiving and sending messages, I try to update those informations in my form (red and green lights) but nothing happens in a form. It could sometimes be quite a long subroutine to send and receive those messages and during that subroutine there could be many changes in a lights. Those lights updates only until my subroutine ends.

So how can I update those lights during my subroutine??

Thanks in advance!
0
Comment
Question by:majala
  • 4
  • 2
  • 2
8 Comments
 
LVL 1

Expert Comment

by:macu
ID: 2526560
Use FormName.Refresh And/Or ControlName.Refresh after each light change.
0
 
LVL 10

Accepted Solution

by:
caraf_g earned 200 total points
ID: 2526561
place the command DoEvents at strategic positions in your code.

Also worth trying: Refresh.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2526563
Photo finish <g>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:jjsc
ID: 2526569
You may also want to try the odd DoEvents() at strategic places in the code. Be aware, though, that DoEvents() can bring its own problems in that your code may (potentially) stop while some other process takes the CPU.

John
0
 
LVL 1

Expert Comment

by:macu
ID: 2526576
Call it a draw.... :)
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2526646
jjsc right on our heels :o)

"stop while some other process takes the CPU"
I'd hope so! Window's supposed to be "multi-tasking"
0
 
LVL 1

Expert Comment

by:jjsc
ID: 2526673
True, but there are other (less painful) ways to give up the processor - for example, the Sleep API call can be very useful (especially under NT).

Also majala mentioned that one of the update routines could be quite long (with several changes). It may be that executing a DoEvents in the routine is perfectly acceptable (i.e. windows continues to work), but it may also mean that the processing of the function is affected, a side effect that may or may not be important.

And shucks, missed by 1 minute (or 2 maybe :-)

John
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2567964
majala,

Thanks for the points. Next time though, if you feel the answer is less than satisfactory, please ask me for more detail. I'd be happy to help you further in order to get a better grade.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question