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

x
?
Solved

Providing a running total on all machines

Posted on 2000-02-28
6
Medium Priority
?
131 Views
Last Modified: 2010-05-02
I've got 10 PC on a LAN that do wordprocessing in a VB program I wrote.
For reasons I can't go into there must be a running total of the amount of ENTER keystrokes displayed in a Label Control on all of the machines.
Eg. : PC1 presses ENTER - on all of the machines the running total goes up by one. Obviuosly the running total on all the machine must be the same.
How do I accomplish this?
0
Comment
Question by:Heinrichsa
6 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 2564111
You could simply send out a UDP message when the enter key is pressed to all the machines on a specific port to tell them to increment there counter/or just tell them the complete new value that way they will always match.
0
 
LVL 13

Accepted Solution

by:
crazyman earned 600 total points
ID: 2564126
Something like this...

where text1 is the box for trapping key press and lblreturnpresses is the label.



Option Explicit

Private Sub Form_Load()
    Winsock1.Protocol = sckUDPProtocol
    Winsock1.Bind 12345
    lblreturnpresses.Caption = 0
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        With Winsock1
            .RemotePort = 12345
            .RemoteHost = "255.255.255.255"
            .SendData CStr(CInt(lblreturnpresses) + 1)
        End With
    End If
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim strData As String
    Winsock1.GetData strData
    lblreturnpresses = strData
End Sub
0
 
LVL 1

Expert Comment

by:rskathait
ID: 2564486
Can you tell me what is your application architecture.....
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:danlevans
ID: 2566478
Heinrichsa,

Bind all of your applications to a control database table. Update a count field each time the enter key is pressed. Display the count field on all PC's refreshing it with the timer.

Have Fun

Dan

0
 

Author Comment

by:Heinrichsa
ID: 2567740
danlevans,

I would not like to use a database because of the recordlocking that occurs. I know I can use the batch updating of ADO, but even with that it is not so effiecient with high hit rate.

I think crazyman has hit the nail on the head thanks for everyones comments
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2576882
Thanks for the points,glad i could help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

926 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