Solved

Providing a running total on all machines

Posted on 2000-02-28
6
123 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

747 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

14 Experts available now in Live!

Get 1:1 Help Now