Solved

Providing a running total on all machines

Posted on 2000-02-28
6
124 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 200 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DO Loop not working 4 72
Using "ScreenUpdating" 6 55
Hide vba in gp 7 83
Child Form in front 4 39
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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

861 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now